SyndicationLink.RelationshipType 属性

定义

获取或设置链接资源的关系类型。

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

属性值

String

链接资源的关系类型。

示例

下面的代码演示如何设置联合链接的关系类型。

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

<link customAttribute="value" rel="alternate" type="text/html" title="Link Title" length="1000" href="http://server/link" />

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

<a10:link customAttribute="value" rel="alternate" type="text/html" title="Link Title" length="1000" href="http://server/link" />

注解

已知关系类型包括:

  • alternate - 链接标识由包含源或项描述的资源的备用版本。

  • related — 该链接识别与外层源或项关联的资源。

  • self - 链接标识与包含源或项等效的资源。

  • enclosure — 该链接识别相关资源,其大小可能很大,还可能需要特殊处理。 此链接关系通常用于在源中分发播客或音频文件的情况。

  • via — 该链接识别充当外层源或项中所提供信息的来源的资源。

序列化为 Atom 1.0 时,会将此值以 rel 元素的 <link> 属性形式写出。 序列化为 RSS 2.0 时,会将此值以 rel 元素中的 <a10:link> 属性形式写出。

适用于