Following code will help you to simply read a XML file and get the content in string object
public string ConvertXMLToString(string xmlFilePath)
{
string xmlOutput = "";
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(xmlFilePath);
if (xmlDocument != null)
{
xmlOutput = xmlDocument.OuterXml.ToString();
}
xmlDocument = null;
return xmlOutput;
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment