• c# 得到 XML的节点值和属性值


    System.Xml.XmlNode node

    //得到XML的属性值

    node.Attributes["HotelCode"].Value;

    node["BasicProperty"]["Address"]

    得到节点下面的节点内容值

    得到节点的内容

      /// <summary>
        ///得到节点值的内容,如果为Null 返回 ""
        /// </summary>
        /// <param name="node">得到指定节点的值</param>
        /// <returns></returns>   
        public static string GetXmlNodeInnerText(System.Xml.XmlNode node)
        {
            string Result = "";
            if (node != null)
            {
                Result = node.InnerText;
            }
            else
            {
                Result = "";
            }
            return Result;
        }

  • 相关阅读:
    express4.x socket
    validator
    服务管理,Dll查看
    复制程序,获取系统信息
    TCP HelloWord
    UDP HelloWord
    [置顶] 一个小马
    注册表编辑
    服务的启动与停止
    自下载运行
  • 原文地址:https://www.cnblogs.com/yqie/p/2486929.html
Copyright © 2020-2023  润新知