【发布时间】:2017-01-26 13:51:42
【问题描述】:
public RSS_Reader()
{
this.InitializeComponent();
}
public static async Task<string> DownloadPageAsync(string pageURL)
{
HttpClient client = new HttpClient();
HttpResponseMessage response = await client.GetAsync("http://www.parliament.uk/g/RSS/news-feed/?pageInstanceId=209&limit=20");
HttpContent content = response.Content;
string result = await content.ReadAsStringAsync();
return result;
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
var parameter = e.Parameter as string;
strURL = parameter.ToString();
Task<string> strXML = DownloadPageAsync(strURL);
ListBoxRss.Items.Add(strXML.Result);
}
我一直在制作的 wp8 应用程序的一部分。该应用程序的主登录页面链接到我从上面获取代码的第二页。第二页实际上从未加载,它只是挂在第一页上。
我做错了什么? 谢谢。
【问题讨论】:
标签: c# xml wpf rss httpclient