在.Net Framework 4.0中调用Web服务 [英] Calling Web Service in .Net Framework 4.0
本文介绍了在.Net Framework 4.0中调用Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要从.NET 4.0 Windows应用商店应用程序异步调用Web服务。我试图做很多方法也无法解决这个问题。请...请问我如何解决这个问题。
I need to asychronously call a web service from an .NET 4.0 Windows Store Apps. I trying to do many method also cannot solve this problem. Please...Please how me solve this problem.
private void btnlogin_Click(object sender, RoutedEventArgs e)
{
ServiceReference1.Service1SoapClient myClient = new ServiceReference1.Service1SoapClient();
myClient.loginwebCompleted += new EventHandler<servicereference1.loginwebcompletedeventargs> (myClient_loginwebCompleted);
myClient.loginwebAsync(txtusername.Text, txtpassword.Text);
}
void myClient_loginwebCompleted(object sender, ServiceReference1.loginwebCompletedEventArgs e)
{
string x;
x = e.Result;
messageBox.Show(e.Result);
}
推荐答案
您好,
查看此网站希望它可以解决您的问题。< br $> b $ b
http://www.c-sharpcorner.com/uploadfile/99bb20/consume-web-service-in-metro-style-app/ [ ^ ]
http://blogs.msdn.com/b/dotnet/archive/2012/11/30/asynchronous-programming-for-windows-store-apps-net-is-up -to-task.aspx [ ^ ]
http://devproconnections.com/aspnet/calling-web-services-asynchronously [ ^ ]
Hi,
Check this websites hope it may solve your problem.
http://www.c-sharpcorner.com/uploadfile/99bb20/consume-web-service-in-metro-style-app/[^]
http://blogs.msdn.com/b/dotnet/archive/2012/11/30/asynchronous-programming-for-windows-store-apps-net-is-up-to-the-task.aspx[^]
http://devproconnections.com/aspnet/calling-web-services-asynchronously[^]
这篇关于在.Net Framework 4.0中调用Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文