CgwMonitorManage.Common.CommonFunction.GetSingleNodeValue C# (CSharp) Method

GetSingleNodeValue() public static method

读取Node节点值
public static GetSingleNodeValue ( XmlElement xmlElement, string nodeName ) : string
xmlElement System.Xml.XmlElement
nodeName string
return string
        public static string GetSingleNodeValue(XmlElement xmlElement, string nodeName)
        {
            XmlNode node = xmlElement.SelectSingleNode(nodeName);
            if (node == null)
            {
                throw new Exception(string.Format("The element is not contain the child node.Node:{0}.", nodeName));
            }

            return node.InnerText.Trim();
        }