Reading an XML file
Easy way of reading an xml file without linq or xpath
XmlDocument comment = new XmlDocument();
//full path. use .Load for URL
comment.LoadXml(File.ReadAllText(myfile.FullName));
XmlNodeList xnList = comment.SelectNodes("/RootNode");
foreach (XmlNode xn in xnList)
{
title = xn["Title"].InnerText;
description = xn["Content"].InnerText;
}
Comments
Post a Comment