共用方式為


SyndicationItem.SaveAsRss20(XmlWriter) 方法

定義

以 RSS 2.0 格式將新聞訂閱項目寫入指定的 XmlWriter

public:
 void SaveAsRss20(System::Xml::XmlWriter ^ writer);
public void SaveAsRss20 (System.Xml.XmlWriter writer);
member this.SaveAsRss20 : System.Xml.XmlWriter -> unit
Public Sub SaveAsRss20 (writer As XmlWriter)

參數

writer
XmlWriter

要寫入的目標 XmlWriter

範例

下列程式碼會示範如何將 RSS 2.0 格式的新聞訂閱項目儲存至指定的 XML 寫入器。

SyndicationItem item = new SyndicationItem("Item Title", "Item Content", new Uri("http://Item/Alternate/Link"), "itemID", DateTimeOffset.Now);
XmlWriter writer = XmlWriter.Create("outfile.xml");
item.SaveAsRss20(writer);
writer.Close();
Dim item As New SyndicationItem("Item Title", "Item Content", New Uri("http:' Item/Alternate/Link"), "itemID", DateTimeOffset.Now)
Dim writer As XmlWriter = XmlWriter.Create("outfile.xml")
item.SaveAsRss20(writer)
writer.Close()

適用於