日期:2014-05-17 浏览次数:20579 次
XmlDocument xmldoc = new XmlDocument(); xmldoc.Load(Server.MapPath("xmltest.xml")); XmlNode xn = xmldoc.SelectSingleNode("//data/name"); Response.Write(xn.Attributes["text"].Value);
------解决方案--------------------
XElement xEl=XElement.Load(@"C:\Documents and Settings\Administrator\桌面\Test.txt"); string value = xEl.Value;//hello