08-31-2010, 01:18 PM
For saving crap, databases etc. Like settings files (ini).
Imports:
Code:
Usage:
Imports:
Code:
using System.Xml;
Code:
Code:
// Reading
XmlDocument XMLReader = new XmlDocument();
XMLReader.Load("Settings.xml");
foreach (XmlNode Information in XMLReader.SelectNodes("/Information")) //Add inner Nodes /Information/Other/Other/Other
{
Console.WriteLine("FirstName={0}", Information.Attributes["FirstName"].InnerText);
Console.WriteLine("LastName={0}", Information.Attributes["LastName"].InnerText);
}
// Writing
XmlTextWriter XMLWriter = new XmlTextWriter("Settings.xml", null);
XMLWriter.WriteStartElement("Information");
XMLWriter.WriteAttributeString("FirstName", "*Your FirstName*");
XMLWriter.WriteAttributeString("LastName", "*Your LastName*");
XMLWriter.WriteEndElement();
XMLWriter.Close();
Usage:
Code:
Look up ;D