Code: Select all
XmlDocument xml = new XmlDocument();
try
{
xml.LoadXml(myString);
}
catch (Exception ex)
{
System.IO.File.WriteAllText(@"C:\text.txt", myString + "\r\n\r\n" + ex.Message);
throw ex;
}
Code: Select all
myString
Code: Select all
Code: Select all
text.txt
Code: Select all
Data at the root level is invalid. Line 1, position 1.