Mega Code Archive

 
Categories / C# / XML
 

XmlReader Item Property returns the value of the attribute with the specified Name

using System; using System.IO; using System.Xml; public class Sample {     public static void Main()     {         XmlReader reader = XmlReader.Create("book.xml");         reader.ReadToDescendant("book");         string isbn = reader["ISBN"];         Console.WriteLine("The ISBN value: " + isbn);     } }