C# 读取xml
//xml -解析 private void xmldode() { XmlDocument doc = new XmlDocument(); String stpa = "XMLFile1.xml"; //解析当前目录xml文件 doc.Load(stpa); XmlNodeList list = doc.SelectNodes("bookstore/nihao/title"); foreach (XmlNode node in list) { oulog(node.Name + ":" + node.InnerText); /*** *输出为元素+实例 * * **/ } }
时间: 2024-10-13 15:26:51