Esempio n. 1
0
        static void Main(string[] args)
        {
            //我们可以看到服务器响应的时间刚好为10s,正好是线程休眠的时间,并且客户端返回了信息

            ProductClient client = new ProductClient();

            Console.WriteLine(DateTime.Now);
            string result = client.GetProduct("李林峰");

            Console.WriteLine(result);
            Console.WriteLine(DateTime.Now);
            Console.ReadLine();
        }
Esempio n. 2
0
        protected void Unnamed1_Click(object sender, EventArgs e)
        {
            ProductClient client = new ProductClient();

            lblMsg.Text = client.GetProduct(txtName.Text);
        }