Hello,
i try to read a XML file in C# but everytime i got the Error "Data at the root level is invalid. Line 1, position 1."
I dont know how to fix it. Can anyone help me?
This is my code:
if ((filename.ToLower() == "lead.xml" || filename.ToLower() == "lead.xml.xml") && ent.Attributes.Contains("body"))//aktualisieren
{
byte[] data = Convert.FromBase64String(ent.Attributes["body"].ToString());
string xml = Encoding.UTF8.GetString(data);
XmlDocument doc = new XmlDocument();
doc.LoadXml(xml);
doc.PreserveWhitespace = false;
XmlNode root = doc.DocumentElement;
tracingService.Trace("läuft2");
foreach (XmlNode node in root)
{
if (node.Name == "recipient")
{...
*This post is locked for comments
I have the same question (0)