2013-03-03 20 views
0

我有以下rss飼料,它有關於其他rss飼料的信息,最終它會有數據。 當用戶選擇任何rss訂閱源(我想通過它們的名稱顯示根rss訂閱源的子rss訂閱源)時,將顯示關於所選rss訂閱源的信息。如何使用c#.NEt閱讀rss在windows phone中傳輸數據?

http://www.espncricinfo.com/ci/content/rss/feeds_rss_cricket.html

public static void Read(string url) 
    { 
     WebClient webClient = new WebClient(); 
     webClient.DownloadStringCompleted += webClient_DownloadStringCompleted; 
     webClient.DownloadStringAsync(new Uri(url));    
    } 

static void webClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) 
    { 
     XDocument document = XDocument.Parse(e.Result); 

     //return (from descendant in document.Descendants("item") 
     //  select new RssNews() 
     //  { 
     //   Description = descendant.Element("description").Value, 
     //   Title = descendant.Element("title").Value, 
     //   PublicationDate = descendant.Element("pubDate").Value 
     //  }).ToList(); 
    } 

我嘗試下面的代碼,但它顯示了一個exception.Any知道如何解決這一問題?

異常類型「System.Reflection.TargetInvocationException」發生在System.ni.dll但在用戶代碼中沒有處理

回答