XmlDocument.Load Vs XmlDocument.LoadXml

前端 未结 5 1487
面向向阳花
面向向阳花 2021-01-07 18:41

I just came across with a problem using XmlDocument.LoadXml.

The application was crashing, giving the following error:

\"Data at

5条回答
  •  既然无缘
    2021-01-07 19:17

    XmlDocument.Load is used to load XML either from a stream, TextReader, path/URL, or XmlReader. XmlDocument.LoadXml is used to load the XML contained within a string.

    They're fundamentally different ways of loading XML, depending on where the XML is actually stored. So it sounds like you were using the wrong method for where your XML is.

提交回复
热议问题