SyndicationLink.Title 属性

定义

获取或设置链接资源的标题。

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

属性值

链接资源的标题。

示例

下面的代码演示如何设置联合链接的标题。

SyndicationFeed feed = new SyndicationFeed("Feed Title", "Feed Description", new Uri("http://Feed/Alternate/Link"), "FeedID", DateTime.Now);

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

Dim link As SyndicationLink = New SyndicationLink(New Uri("http://server/link"), "alternate", "Link Title", "text/html", 1000)
feed.Links.Add(link)

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

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

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

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

注解

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

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

适用于