Data at the root level is invalid. Line 1, position 1 -why do I get this error while loading an xml file?

拈花ヽ惹草 提交于 2019-11-26 09:44:51

问题


Data at the root level is invalid. Line 1, position 1 -why I get this error while load xml file

this my code:

XmlDocument xmlDoc=new XmlDocument();
xmlDoc.LoadXml(\"file.xml\");

回答1:


The LoadXml method is for loading an XML string directly. You want to use the Load method instead.



来源:https://stackoverflow.com/questions/7544475/data-at-the-root-level-is-invalid-line-1-position-1-why-do-i-get-this-error-w

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!