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();
        }