Share via


SyndicationFeed.ImageUrl 屬性

定義

取得或設定摘要的影像 URL。

public:
 property Uri ^ ImageUrl { Uri ^ get(); void set(Uri ^ value); };
public Uri ImageUrl { get; set; }
member this.ImageUrl : Uri with get, set
Public Property ImageUrl As Uri

屬性值

Uri

摘要影像的 URL。

範例

下列程式碼會示範如何設定 ImageUrl 執行個體的 SyndicationFeed

SyndicationFeed feed = new SyndicationFeed("Feed Title", "Feed Description", new Uri("http://Feed/Alternate/Link"), "FeedID", DateTime.Now);
feed.ImageUrl = new Uri("http://contoso/images/TestFeedImage");
Dim feed = New SyndicationFeed("Feed Title", "Feed Description", New Uri("http:'Feed/Alternate/Link"), "FeedID", DateTime.Now)
feed.ImageUrl = New Uri("http:'contoso/images/TestFeedImage")

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

<logo>http://contoso/image.jpg</logo>

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

<image>
  <url>http://contoso/image.jpg</url>
  <title>Feed Title</title>
  <link>http://feed/Alternate/Link</link>
</image>

備註

序列化為 Atom 1.0 時, ImageUrl 屬性會寫入 <logo> 元素。

序列化為 RSS 2.0 時, ImageUrl 屬性會寫入 <image> 元素。

適用於