zoukankan      html  css  js  c++  java
  • c# 测试

    string input = "//a/@href ";
                int index = input.IndexOf("/@");
                String attr = input.Substring(index+2);
                Console.WriteLine("attr=@href");
    ArrayOf 
    <ArrayOfTileResourceInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <TileResourceInfo> <TileMatrixMin>17</TileMatrixMin> <TileMatrixMax>17</TileMatrixMax> <LatMin>36.03515625</LatMin> <LatMax>42.626953125</LatMax> <LonMin>113.433837890625</LonMin> <LonMax>119.8828125</LonMax> <City>***</City> <TileType>***</TileType> <Style>dom</Style> <TileMatrixSet>Matrix_0</TileMatrixSet> <Layer>dom</Layer> <Format>image/tile</Format> <Uri>http://110.249.157.236/domTile/wmts</Uri> </TileResourceInfo> <TileResourceInfo> <TileMatrixMin>17</TileMatrixMin> <TileMatrixMax>17</TileMatrixMax> <LatMin>27.037353515625</LatMin> <LatMax>32.0</LatMax> <LonMin>117.1636962890625</LonMin> <LonMax>123.189697265625</LonMax> <City>*****</City> <TileType>****</TileType> <Style>ZJDOM2W1</Style> <TileMatrixSet>Matrix_0</TileMatrixSet> <Layer>**********</Layer> <Format>image/tile</Format> <Uri>******************</Uri> </TileResourceInfo> </ArrayOfTileResourceInfo>
    Type type = typeof(T);
                T ass = (T)Assembly.GetAssembly(type).CreateInstance(type.FullName);
    
                XmlDocument xdResult = new XmlDocument();
                XmlDeclaration dec = xdResult.CreateXmlDeclaration("1.0", null, null);
                xdResult.AppendChild(dec);
                XmlElement root = xdResult.CreateElement(type.Name);
                xdResult.AppendChild(root);
    
                XmlElement xe = xdResult.CreateElement("Name");
                xe.InnerText = "羊驼";
                root.AppendChild(xe);
    
                XmlSerializer xs = new XmlSerializer(type);
                StringReader reader=new StringReader(xdResult.OuterXml);
                T o = (T)xs.Deserialize(reader);       
  • 相关阅读:
    「CSP模拟」模拟测试6
    「CSP模拟」模拟测试5
    镇黑板
    求和「Dirichlet 前缀和」
    二叉搜索树「区间DP」
    序列
    [CSP模拟]异或帽子+传话游戏+全球覆盖+幂次序列
    MySQL常用引擎及优缺点
    Django项目远程开发环境搭建
    MySQL8.0安装与配置
  • 原文地址:https://www.cnblogs.com/i80386/p/3169117.html
Copyright © 2011-2022 走看看