CgwMonitorManage.Common.CommonFunction.GetSingleNodeValue C# (CSharp) 메소드

GetSingleNodeValue() 공개 정적인 메소드

读取Node节点值
public static GetSingleNodeValue ( XmlElement xmlElement, string nodeName ) : string
xmlElement System.Xml.XmlElement
nodeName string
리턴 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();
        }