c# 读取 XML

XmlDocument xmldoc = new XmlDocument();
string xmlPath = HttpContext.Server.MapPath("~/*****.xml");
xmldoc.Load(xmlPath);
XmlElement root = xmldoc.DocumentElement;
string node = root.SelectSingleNode("/images/image[@id='1']/url").InnerText;
<?xml version="1.0" encoding="utf-8" ?>
<images>
  <image id="0">
    <url>/images/0.png</url>
  </image>
  <image id="1">
    <url>/images/1.png</url>
  </image>
</images>
原文地址:https://www.cnblogs.com/Jerrycjc/p/5151721.html