SyndicationFeed.Id 属性

定义

获取或设置源的 ID。

public:
 property System::String ^ Id { System::String ^ get(); void set(System::String ^ value); };
public string Id { get; set; }
member this.Id : string with get, set
Public Property Id As String

属性值

String

源的 ID。

示例

下面的代码演示如何在 Id 实例上设置 SyndicationFeed 属性。

SyndicationFeed feed = new SyndicationFeed("Feed Title", "Feed Description", new Uri("http://Feed/Alternate/Link"), "FeedID", DateTime.Now);
feed.Id = "SyndicationFeedId";
Dim feed As New SyndicationFeed("Feed Title", "Feed Description", New Uri("http:'Feed/Alternate/Link"), "FeedID", DateTime.Now)
feed.Id = "SyndicationFeedId"

下面的 XML 演示如何将 Id 属性序列化为 Atom 1.0。

<id>FeedID</id>

下面的 XML 演示如何将 Id 属性序列化为 RSS 2.0。

<a10:id>FeedID</a10:id>

注解

序列化为 Atom 1.0 时,将 Id 写入 <id> 元素。

序列化为 RSS 2.0 时,将 Id 写入元素 <a10:id>

适用于