从SyndicationContent读取内容文本

时间:2009-11-27 00:38:02

标签: asp.net feeds syndicationfeed syndication-item

您好我正在尝试从Feed项中读取内容到字符串中。

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); 

有什么方法可以扭转这种局面吗?

感谢

2 个答案:

答案 0 :(得分:23)

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

答案 1 :(得分:-1)

您可以查看SyndicationFeedSyndicationContent