Persist XmlDoc To File using TextWriter

How to use TextWriter to file.


<pre>
            string strOutFileName = @"c:YourDirYourFile.xml";
   ... assumes you have an xmlDoc somewhere
            System.Xml.XmlTextWriter tw = new XmlTextWriter(strOutFileName, System.Text.Encoding.ASCII);
            xmlDoc.WriteTo(tw);
            //xmlTypedDoc.Document.WriteTo(tw);
            tw.Close();
</pre>

Uncategorized  

Leave a Reply