Mega Code Archive

 
Categories / C# Tutorial / XML
 

To read from an XML file

using System; using System.IO; using System.Xml; class MainClass {   static void Main(string[] args)   {     XmlTextReader reader = new XmlTextReader("Sample.xml");     // Read the File     while (reader.Read())     {            }     if (reader != null)       reader.Close();   } }