Mega Code Archive

 
Categories / C# / XML
 

XmlReader ReadElementContentAsLong reads the element and returns a 64-bit signed integer

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