Mega Code Archive

 
Categories / C# / XML
 

XmlReader ReadElementContentAsDouble reads element and returns the contents as a double

using System; using System.IO; using System.Xml; public class Sample  {   public static void Main(){         using (XmlReader reader = XmlReader.Create("dataFile.xml")) {              reader.ReadToFollowing("double");              Double number = reader.ReadElementContentAsDouble();              // Do some processing with the number object.           }   } }