从 SyndicateContent 读取内容文本

发布于 2024-08-12 12:22:58 字数 594 浏览 4 评论 0原文

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

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

如何从 itemContent 中读取文本?

该文档显示了如何创建 TextSyndicateContent

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

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

有什么方法可以逆转这个问题吗?

谢谢

Hi i am trying to read the content into string from feed items.

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

how can I read the text from the itemContent ?

The documentation shows how to create TextSyndicationContent

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

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

Any way to reverse this ?

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

荒路情人 2024-08-19 12:22:58
TextSyndicationContent tsc = (TextSyndicationContent)item.Content;
string myContent = tsc.Text;
TextSyndicationContent tsc = (TextSyndicationContent)item.Content;
string myContent = tsc.Text;
灰色世界里的红玫瑰 2024-08-19 12:22:58

您可以查看 SyndicateFeed 或位于SyndicateContent

You could take a look at SyndicationFeed or at SyndicationContent.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文