以下是我在SilverLight中使用的代码来调用Web服务。
我想知道一种方法,在运行RunHelloAsync(Command)后,不需要进入Completed事件就能获取返回的结果。请给我建议。谢谢。
private void button1_Click(object sender, RoutedEventArgs e)
{
BasicHttpBinding bind = new BasicHttpBinding();
EndpointAddress endpoint = new EndpointAddress("http://loalhost/Service.asmx");
ServiceSoapClient client = new ServiceSoapClient(bind, endpoint);
client.RunHelloCompleted += new EventHandler<RunHelloCompletedEventArgs>(client_RunQwinCompleted);
client.RunHelloAsync(command);
}
void client_RunHelloCompleted(object sender, RunHelloCompletedEventArgs e)
{
txtProcess.Text=Process(e.Result);
}
我想知道一种方法,在运行RunHelloAsync(Command)后,不需要进入Completed事件就能获取返回的结果。请给我建议。谢谢。