SyndicationItem.Id 属性

定义

获取或设置联合项的 ID。Gets or sets the ID of the syndication item.

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。The ID of the syndication item.

示例

下面的代码演示如何在 Id 实例上设置 SyndicationItem 属性。The following code shows how to set the Id property on a SyndicationItem instance.

SyndicationItem item = new SyndicationItem("Item Title", "Item Content", new Uri("http://Item/Alternate/Link"));
item.Id = "ItemID";
Dim item As New SyndicationItem("Item Title", "Item Content", New Uri("http:' Item/Alternate/Link"))
item.Id = "ItemID"

下面的 XML 演示如何将此属性序列化为 Atom 1.0。The following XML shows how this property is serialized to Atom 1.0.

<id>Item ID</id>  

下面的 XML 演示如何将此属性序列化为 RSS 2.0。The following XML shows how this property is serialized to RSS 2.0.

<guid isPermaLink="false">Item ID</guid>  

注解

序列化为 Atom 1.0 时,会将此属性写入 <id> 元素。When serialized to Atom 1.0, this property is written to the <id> element. 序列化为 RSS 2.0 时,会将此属性写入 <guid> 元素。When serialized to RSS 2.0, this property is written to the <guid> element.

适用于