求助,新手解析xml
<?xml version="1.0" encoding="GBK">
<root>
<QueryCondition>
<hpzl>01</hpzl>
<hphm>苏CM8879</hphm>
....
</QueryCondition>
</root>
</root>
我想取出 01和 苏CM8879
[解决办法]
- C# code
XmlDocument d = new XmlDocument();d.Load(@"F:\1.xml");XmlNodeList nodes = d.SelectNodes("//QueryCondition");foreach (XmlNode x in nodes) MessageBox.Show(x["hpzl"].InnerText + " = " + x["hphm"].InnerText);