我使用
WebClient
在Windows Phone 8和Android上获取Yahoo数据,而HttpClient则可以实现同样的功能。 WebClient client = new WebClient();
client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
client.DownloadStringAsync(url);
发送事件后;
StringReader stream = new StringReader(e.Result)
XmlReader reader = XmlReader.Create(stream);
reader.ReadToFollowing("yweather:atmosphere");
string humidty = reader.MoveToAttribute("humidity");
但在Windows 8 RT中不存在这样的东西。
我如何获取以下数据? >http://weather.yahooapis.com/forecastrss?w=2343732&u=c
HttpClient
吗? - Davin Tryon