110,538
社区成员
发帖
与我相关
我的任务
分享
XmlDocument xml = new XmlDocument();
//如果是字符串
// String str = "<><>";
// xml.LoadXml(str);
//如果是文件
xml.Load(Server.MapPath("test.xml"));
XmlNodeList node = xml.SelectNodes("//TAG/tagid");
XmlNode resultNode = null;
foreach(XmlNode item in node)
{
if (item.InnerText == "105461601172 ")
{
resultNode = item;
break;
}
}
XmlDocument doc = new XmlDocument();
doc.Load(@"文件位置");
XmlNode node = doc.SelectSingleNode("response/TAG[tagid=105461601172]");//根据xpath,这里我把你数字后面的空格去掉了
string mac = node.ChildNodes[1].InnerText;//根据排列规律(tag下面的第二个节点)
string type = node.ChildNodes[2].InnerText;
string ip = node.ChildNodes[9].InnerText;