2009-11-27 68 views
7

嗨,我想從Feed項目中讀取字符串的內容。閱讀來自SyndicationContent的內容文本

SyndicationFeed feed = SyndicationFeed.Load(feedReader);  
SydicationContent itemContent = feed.Items.ToList<SyndicationItem>()[0].Content; 
string retrivedContent = itemContent .......??? 

如何從itemContent中讀取文本?

文檔演示如何創建TextSyndicationContent

TextSyndicationContent textContent = new TextSyndicationContent("Some text content"); 

SyndicationItem item = new SyndicationItem("Item Title", textContent, new Uri("server/items";), "ItemID", DateTime.Now); 

任何辦法扭轉這一點?

感謝

+0

你應該考慮接受AndyH的回答而不是給定的答案。 – 2015-11-10 02:28:27

回答

-1

你可以看看SyndicationFeedSyndicationContent

+0

Thsnks任何方式,我切換到argotic框架,將推薦任何一個堅持與SyndicaticationFeed看看。 http://argotic.codeplex.com/ 歡呼聲 – 2009-11-27 02:13:35

23
TextSyndicationContent tsc = (TextSyndicationContent)item.Content; 
string myContent = tsc.Text;