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 - 連結會識別大小可能巨大而需要特殊處理的相關資源。 在摘要中發行 Podcast 或音訊檔案時,通常就會使用這個連結關聯。

  • via - 連結會識別身為包含摘要或項目中提供之資訊來源的資源。

序列化為 Atom 1.0 時,此值會寫出做為 rel 項目的 <link> 屬性。 序列化為 RSS 2.0 時,此值會寫出做為 rel 項目中的 <a10:link> 屬性。

適用於