load xml document
Published: 14. January 2009 | Updated: 26. October 2011License: Microsoft Public License (MS-PL)
Categories: Streams, Framework » XML
Tags: C# XML
Import namespaces
using System.IO; using System.Xml;
Code
// create instance of new xml document XmlDocument doc = new XmlDocument(); // load from file by path doc.Load(@"C:\sitemap.xml"); // load from stream doc.Load(File.OpenText(@"C:\sitemap.xml")); // load from url doc.Load(@"http://www.csharpdeveloping.net/sitemap.xml"); // load from string doc.LoadXml("<url><loc>http://www.csharpdeveloping.net/</loc></url>");
| Send us feedback about this snippet » |





