SyndicationFeed.Generator 属性

定义

获取或设置源生成器。

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

属性值

生成源的工具名称。

示例

下面的代码演示如何设置 GeneratorSyndicationFeed

SyndicationFeed feed = new SyndicationFeed("Feed Title", "Feed Description", new Uri("http://Feed/Alternate/Link"), "FeedID", DateTime.Now);
feed.Generator = "Generator Name or Description";
Dim feed As New SyndicationFeed("Feed Title", "Feed Description", New Uri("http:'Feed/Alternate/Link"), "FeedID", DateTime.Now)
feed.Generator = "Generator Name or Description"
<title type="text">Feed Title</title>

下面的 XML 演示如何将 Generator 属性序列化为 Atom 1.0 和 RSS 2.0。

<generator>Sample Code</generator>

注解

序列化为 Atom 1.0 和 RSS 2.0 时, Generator 会写入 <generator> 元素。

适用于