private void button2_Click(object sender, RoutedEventArgs e)
{
WebClient wb = new WebClient();
wb.DownloadStringCompleted += new DownloadStringCompletedEventHandler(wb_DownloadStringCompleted);
wb.DownloadStringAsync(new Uri("http://weather.yahooapis.com/forecastrss?w=2502265"));
}
void wb_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
XElement xmlResult = XElement.Parse(e.Result);
}
这是code我已经使用。我得到一个错误无法连接到远程服务器。 我能够从仿真器IE浏览器连接到互联网。
This is code i have used. I am getting an error "Unable to connect to the remote server". I am able to connect to internet from the IE browser in the emulator.
推荐一个合适的解决方案。
Suggest a suitable solution.
你有没有尝试重新启动你的模拟器?因为它发生在我身上:我得到这个错误的仿真器,但没有一个简单的控制台PROGRAMM。 VS重新启动后,它的工作原理。
Did you try to restart your emulator ? Because it happens to me : I got this error with the emulator but none with a simple console programm. After a restart of VS, it works.
上一篇:WPF进度控制调度仍要堵塞UI线程线程、进度、仍要、WPF
下一篇:对于HttpWebRequest.Credentials建设CredentialCache时重定向是UKNOWN重定向、Credentials、HttpWebRequest、UKNOWN