问题
I am writing a Windows 8.1 store app and I need to read a local xml file produces a general error trying to load the file.
Here's the file and code:
XmlDocument doc = new XmlDocument();
doc.LoadXml(@"C:\Users\Martin\Desktop\eventList2.xml");
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<EventList>1</EventList>
回答1:
doc.LoadXml() expects XML string as parameter. To load XML from file, use doc.Load(@"C:...");
来源:https://stackoverflow.com/questions/26952259/reading-xml-file-causes-hresult-0xc00ce556