我无法使用Windows Phone应用程序连接到Web服务

时间:2014-03-22 23:59:33

标签: c# web-services windows-phone-8 windows-phone

我是Windows手机应用程序的新手;我已经多次尝试连接到位于服务器上的webservice但没有白费。我出现了一个错误(mscorlib.ni.dll中出现'System.Collections.Generic.KeyNotFoundException'类型的第一次机会异常),任何人都可以帮助我连接到这个web服务。 (Visual Studio 2013)?

我尝试使用这个简单的代码来测试连接:

private void Button_Click(object sender, RoutedEventArgs e)
{
    ServiceReference1.WebServiceClient myClient = new ServiceReference1.WebServiceClient();

    myClient.LoginAsync("hello", "1234");

    myClient.LoginCompleted += new EventHandler<ServiceReference1.LoginCompletedEventArgs> (myClient_LoginCompleted);

}


void myClient_LoginCompleted(object sender, ServiceReference1.LoginCompletedEventArgs e)
{
    MessageBox.Show(e.Result);
}

0 个答案:

没有答案
相关问题