7

嗨,我正在尝试将提要项目中的内容读入字符串。

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

有什么办法可以扭转这种情况?

谢谢

4

2 回答 2

25
TextSyndicationContent tsc = (TextSyndicationContent)item.Content;
string myContent = tsc.Text;
于 2010-06-02T13:45:36.060 回答
-1

您可以查看SyndicationFeedSyndicationContent

于 2009-11-27T00:42:38.303 回答