从XML对象中查找指定节点的值
/// <summary> /// 从XML对象中查找指定节点的值 /// </summary> /// <param name="xmlDoc">XmlDocument对象</param> /// <param name="XPath">具体节点</param> /// <returns></returns> public static string GetXMLValue(XmlDocument xmlDoc, string xPath) { string value = string.Empty; try { XmlNode xmlNode = xmlDoc.SelectSingleNode(xPath); value = xmlNode.InnerText; } catch { } return value; }