【发布时间】:2014-07-16 15:47:21
【问题描述】:
我正在尝试从仅包含我的 Windows Phone 8 应用程序的文本的授权受限数据库中检索数据。我的代码如下所示:
private void Button_Click_1(object sender, RoutedEventArgs e)
{
WebClient wc = new WebClient();
wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(wc_DownloadStringCompleted);
wc.Credentials = new NetworkCredential("username", "password");
wc.DownloadStringAsync(new Uri(@"http://www.siteaddress.com"));
}
void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
string text = e.Result;
}
不幸的是,我收到了以下消息。我做错什么了吗?提前致谢。 http://s30.postimg.org/yuc0mcb5t/pic.png
【问题讨论】:
标签: c# authentication windows-phone-8 webclient