private void btnSync_Click(object sender, EventArgs e) { TestProxy.DataServiceClient client = new TestProxy.DataServiceClient(); string data = client.GetData(); MessageBox.Show(data); }
private void btnAsync_Click(object sender, EventArgs e) { TestProxy.DataServiceClient client = new TestProxy.DataServiceClient(); client.GetDataCompleted += delegate(object src, TestProxy.GetDataCompletedEventArgs args) { MessageBox.Show(args.Result); }; client.GetDataAsync(); }
private void btnThread_Click(object sender, EventArgs e) { Thread th = new Thread( delegate() { TestProxy.DataServiceClient client = new TestProxy.DataServiceClient(); string data = client.GetData(); MessageBox.Show(data); } ); th.Start(); }