silverlight+WCF入门教程
public void DoWork() { return; }
为
public string SayHello(string userName) { return userName + ",hello world!!"; }
4.生成一下;
private void button1_Click(object sender, RoutedEventArgs e) { ServiceReference1.Service1Client ws = new ServiceReference1.Service1Client(); ws.SayHelloCompleted += new EventHandler<ServiceReference1.SayHelloCompletedEventArgs>(SayHelloCompleted); ws.SayHelloAsync(textbox1.Text); } void SayHelloCompleted(object sender, ServiceReference1.SayHelloCompletedEventArgs e) { label1.Content = e.Result; }
8.Just run it!
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。