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);       
  • 相关阅读:
    C#Light 和 uLua的对比第二弹
    Unity3D热更新全书FAQ
    Unity3D热更新全书-脚本(五) NGUI
    Unity3d热更新全书-加载(二)如何在不用AssetBundle的前提下动态加载预设
    Unity3D热更新全书-下载 唯一的一篇
    Unity3D热更新全书-PageZero
    Netty4.x中文教程系列(二) – 白话概念
    Netty4.x中文教程系列(一) Hello World !
    Java NIO(New I/O)的三个属性position、limit、capacity
    Buffer
  • 原文地址:https://www.cnblogs.com/i80386/p/3169117.html
Copyright © 2011-2022 走看看