不能够从WP7仿真器连接到Web服务仿真器、不能够、连接到、Web

2023-09-04 00:51:00 作者:阳光正好只欠拥抱

 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.