110,534
社区成员
发帖
与我相关
我的任务
分享
<?xml version= "1.0 " encoding= "gb2312 "?>
//myBook.xml
<bookstore>
<book genre= "fantasy " ISBN= "2-3631-4 ">
<title> Oberon 's Legacy </title>
<author> Corets, Eva </author>
<price> 5.95 </price>
</book>
</bookstore>
String pathXml=@"d:\xml\myBook.xml";
XmlDocument xml = new XmlDocument();
//这里怎么写
xml.Load(pathXml);
XmlDocument xml = new XmlDocument();
string newXML = System.IO.File.ReadAllText(pathXml, Encoding.UTF8);
xml.LoadXml(newXML);
XmlDocument xml = new XmlDocument();
xml.LoadXml(pathXml);//根级别上的数据无效。 行 1,位置 1。