Share via


SyndicationLink.MediaType 屬性

定義

取得或設定已連結資源的媒體類型。

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

屬性值

String

已連結之資源的媒體類型。

範例

下列程式碼會示範如何設定新聞訂閱連結的媒體類型。

下列 XML 會示範 MediaType 屬性如何序列化為 Atom 1.0。

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

下列 XML 會說明 MediaType 屬性如何序列化為 RSS 2.0。

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

備註

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

適用於