c# - Getting one or more error occured exception in downloading via HttpClient and Parsing with XElement -


i creating news app need support news of multiple language in visual studio xamarin c#. using code below.

list<feeditem> feeditemslist = new list<feeditem>();                 try                 {                     httpclient wc = new httpclient();                      var html = wc.getstringasync(new uri(url)).result;                       xelement xmlitems = xelement.parse(html);                     // need create list of elements                     list<xelement> elements = xmlitems.descendants("item").tolist();                      // we're putting informations got in our listbox in xaml code                     // have use foreach statment able read elements                      // description  , link , title attributes in rssitem class i've added                     list<feeditem> aux = new list<feeditem>();                     foreach (xelement rssitem in elements)                     {                         feeditem rss = new feeditem();                          rss.description = rssitem.element("description").value;                         rss.link = rssitem.element("link").value;                         rss.title = rssitem.element("title").value;                         feeditemslist.add(rss);                      }                 }                 catch (exception)                 {                     throw;                 } 

this code not working https://news.google.com/news/feeds?pz=1&cf=all&ned=zh-hans&hl=china&q=topstories&output=rss

but works http://news.google.com/?output=rss

additional information: code above works fine feedurl in windows phone app.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -