Rss20ItemFormatter.WriteTo(XmlWriter) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Écrit l’associé SyndicationItemRss20FeedFormatter au fichier spécifié XmlWriter.
public:
override void WriteTo(System::Xml::XmlWriter ^ writer);
public override void WriteTo(System.Xml.XmlWriter writer);
override this.WriteTo : System.Xml.XmlWriter -> unit
Public Overrides Sub WriteTo (writer As XmlWriter)
Paramètres
Exemples
Le code suivant montre comment créer un flux de syndication et utiliser un Rss20ItemFormatter pour écrire l’élément dans un XmlWriter.
SyndicationItem item = new SyndicationItem("Test Item", "This is the content for Test Item", new Uri("http://Contoso/ItemOne"), "TestItemID", DateTime.Now);
XmlWriter rssWriter = XmlWriter.Create("RSS.xml");
Rss20ItemFormatter rssFormatter = new Rss20ItemFormatter(item);
rssFormatter.WriteTo(rssWriter);
rssWriter.Close();