SelectSingleNode怎么获取xml一个子节点的值??
<REQUEST>
<ROUTE>
<VERSION> 2.0 </VERSION>
<OBJ_RANGE> 01 </OBJ_RANGE>
<RET_FLAG> Y </RET_FLAG>
</ROUTE>
</REQUEST>
strXmlpath = "D:/桌面/xml/loginreq.xml ";
xmldoc.Load(strXmlpath);
XmlDocument xmldoc = new XmlDocument();
XmlNode nodeXml = xmldoc.SelectSingleNode( "VERSION ");//这里取不到节点,为什么???
strText = nodeXml.InnerXml;
请给我看一下!
[解决办法]
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(strXmlpath);
XmlNode node = xmlDocument.SelectSingleNode( "//appSettings ");