zoukankan      html  css  js  c++  java
  • xml

    using System.Xml.Linq;

    protected static string file = System.Web.HttpContext.Current.Server.MapPath("~/test/ruonanxiao.xml");
            public static string GetName()
            {
                string name = string.Empty;
                XElement doc = XElement.Load(file);
                var names = from p in doc.Descendants("name")
                            select p.Value;
                foreach (var n in names)
                {
                    name = n;
                }
                return name;
            }

            public static string GetSex()
            {
                string name = string.Empty;
                XElement doc = XElement.Load(file);
                var names = from p in doc.Descendants("sex")
                            select p.Value;
                foreach (var n in names)
                {
                    name = n;
                }
                return name;
            }

            public static string GetAge()
            {
                string name = string.Empty;
                XElement doc = XElement.Load(file);
                var names = from p in doc.Descendants("age")
                            select p.Value;
                foreach (var n in names)
                {
                    name = n;
                }
                return name;
            }

  • 相关阅读:
    Linux文件系统之INode
    手写Netty之多路复用Select小案例
    多路复用器Select、Poll、Epoll区别梳理
    NAT模式、路由模式、桥接模式的区别
    Netty编解码器(理论部分)
    Netty之Unpooled_Bytebuf
    为什么 TCP 协议有粘包问题
    IDEA_2019.1版本中Protobuf的使用
    Netty服务端Server代码说明
    Netty之ChannelHandler
  • 原文地址:https://www.cnblogs.com/ruonanxiao/p/2439789.html
Copyright © 2011-2022 走看看