• 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);       
  • 相关阅读:
    eclipse中的TODO和FIXME
    使用mui框架后a标签无法跳转
    java.lang.OutOfMemoryError: Java heap space异常
    mysql中表触发器的简单使用
    编写第一个 Java 程序
    QDialog类exec()与show()的区别
    Qt中信号槽connect的多种类型
    2.3 UML活动图
    2.2 UML用例模型
    2.1 uml序言
  • 原文地址:https://www.cnblogs.com/i80386/p/3169117.html
Copyright © 2020-2023  润新知