- XmlElement bookElement = (XmlElement) node;
- string title = bookElement.GetElementsByTagName("title")[0].InnerText;
- string author = bookElement.GetElementsByTagName("author")[0].InnerText;
- string isbn = "";
- if (bookElement.HasAttributes)
- {
- isbn = bookElement.Attributes["ISBN"].InnerText;
- }
- Console.WriteLine("{0} ({1}) is written by {2}\n", title, isbn, author);
Saturday, June 2, 2012
Read Xml File in .net
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment