共用方式為


SyndicationFeed.Links 屬性

定義

取得摘要相關連結。

public:
 property System::Collections::ObjectModel::Collection<System::ServiceModel::Syndication::SyndicationLink ^> ^ Links { System::Collections::ObjectModel::Collection<System::ServiceModel::Syndication::SyndicationLink ^> ^ get(); };
public System.Collections.ObjectModel.Collection<System.ServiceModel.Syndication.SyndicationLink> Links { get; }
member this.Links : System.Collections.ObjectModel.Collection<System.ServiceModel.Syndication.SyndicationLink>
Public ReadOnly Property Links As Collection(Of SyndicationLink)

屬性值

SyndicationLink 物件的集合。

範例

下列程式碼會示範如何將連結加入至 Links 執行個體的 SyndicationFeed 集合。

SyndicationFeed feed = new SyndicationFeed("Feed Title", "Feed Description", new Uri("http://Feed/Alternate/Link"), "FeedID", DateTime.Now);
feed.Links.Add(new SyndicationLink(new Uri("http://server/link"), "alternate", "Link Title", "text/html", 1000));
Dim feed As New SyndicationFeed("Feed Title", "Feed Description", New Uri("http:'Feed/Alternate/Link"), "FeedID", DateTime.Now)
feed.Links.Add(New SyndicationLink(New Uri("http:'server/link"), "alternate", "Link Title", "text/html", 1000))

下列 XML 會說明 Links 集合如何序列化為 Atom 1.0。

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

下列 XML 會說明 Links 集合如何序列化為 RSS 2.0。

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

備註

序列化為 Atom 1.0 時, Links 集合會寫入數 <link> 個專案。

序列化為 RSS 2.0 時, Links 集合會寫入數 <a10:link> 個專案。

適用於