简体   繁体   English

如何使用 SyndicationFeed?

[英]How do I use SyndicationFeed?

This may seem like a dumb question, but I cannot for the life of me figure out how to get access to the SyndicationFeed class in c#.这似乎是一个愚蠢的问题,但我终其一生都无法弄清楚如何在 c# 中访问SyndicationFeed类。 Every single example I have seen on MSDN or otherwise assumes that it's already imported, and not a single one I have found gives any indication on where it's located.我在 MSDN 上看到的每个示例或以其他方式假设它已经导入,而我发现的一个示例都没有给出它所在位置的任何指示。

For example, I'm trying to run the following:例如,我正在尝试运行以下命令:

XmlReader reader = XmlReader.Create(rss_url);
SyndicationFeed.Load(reader);

But it fails because SyndicationFeed doesn't exist in the current context.但它失败了,因为SyndicationFeed在当前上下文中不存在。 Does anybody out there know how I can get it in?有大佬知道怎么进去吗?

Read the documentation more carefully:更仔细地阅读文档

Namespace : System.ServiceModel.Syndication命名空间:System.ServiceModel.Syndication
Assembly : System.ServiceModel (in System.ServiceModel.dll)程序集:System.ServiceModel(在 System.ServiceModel.dll 中)

Right-click your project, click Add Reference, then select System.ServiceModel.dll右键单击您的项目,单击添加引用,然后选择 System.ServiceModel.dll

似乎驻留在System.ServiceModel.Syndication

如果您使用 .NET Core,请搜索并安装 NuGet 包:

System.ServiceModel.Syndication

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM