.Net Asp.Net MVC C# Development

Reading XML file

Below is the xml which has two columns File Name and File Path:
XmlDocument xdoc = new XmlDocument(); 
 xdoc.LoadXml(String XML);
foreach (XmlNode n in xdoc.DocumentElement.SelectNodes("/Roots/RootFiles"))
{                            
filesstr.Add(n.SelectSingleNode("File").Attributes["file"].Value);
filepath.Add(n.SelectSingleNode("File").Attributes["path"].Value);
}
ViewData["files"] = filesstr;
ViewData["filespath"] = filepath;

Leave a Reply

Your email address will not be published. Required fields are marked *