您好我正在尝试从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);
有什么方法可以扭转这种局面吗?
感谢
答案 0 :(得分:23)
TextSyndicationContent tsc = (TextSyndicationContent)item.Content;
string myContent = tsc.Text;
答案 1 :(得分:-1)