zoukankan      html  css  js  c++  java
  • 获取xml文件

    <?xml version="1.0" encoding="utf-8" ?>
    <ArrayOfSystemRool xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <SystemRool>
        <Type>A</Type>
        <MasterPlate>win7-1.24</MasterPlate>
        <MasterPlateID>0e384ece-4c25-4016-8ca9-7db99f2c421b</MasterPlateID>
        <OperatingID>c440a422-7447-49b5-a4ce-bccb7ef17a47</OperatingID>
        <SystemName>64-bit edition of Windows 7</SystemName>
        <CpuCount>2</CpuCount>
      </SystemRool>
      <SystemRool>
        <Type>B</Type>
        <MasterPlate>win7-1.24</MasterPlate>
        <MasterPlateID>0e384ece-4c25-4016-8ca9-7db99f2c421b</MasterPlateID>
        <OperatingID>c440a422-7447-49b5-a4ce-bccb7ef17a47</OperatingID>
        <SystemName>64-bit edition of Windows 7</SystemName>
        <CpuCount>2</CpuCount>
      </SystemRool>
      <SystemRool>
        <Type>C</Type>
        <MasterPlate>win7-1.24</MasterPlate>
        <MasterPlateID>0e384ece-4c25-4016-8ca9-7db99f2c421b</MasterPlateID>
        <OperatingID>c440a422-7447-49b5-a4ce-bccb7ef17a47</OperatingID>
        <SystemName>64-bit edition of Windows 7</SystemName>
        <CpuCount>2</CpuCount>
      </SystemRool>
    </ArrayOfSystemRool>

     /// <summary>        

    /// 获取类型和模板        

    /// </summary>       

     /// <returns></returns>        

    public static List<SystemRool> GetRool()        

    {            

    var _str = File.ReadAllText(HttpContext.Current.Server.MapPath("/masterplate.xml"));            

    var _rools = NvWa.Common.DataTypeExtend.SerializeHelper.XMLDeserialize<List<SystemRool>>(_str);            

    return _rools;        

    }

    public class SystemRool        

    {            

    public string Type { get; set; }//类型对应模版

    public string MasterPlate { get; set; }//模版名称

     public string MasterPlateID { get; set; }//模版ID

    public string OperatingID { get; set; }//操作系统名称

     public string SystemName { get; set; }//操作系统名称

     public int CpuCount { get; set; }//CPU个数        

    }

  • 相关阅读:
    js push(),pop(),shift(),unshift()
    bootstrap fileinput 上传文件
    关于dataTable 生成JSON 树
    postgresql+ C#+ DHTMLX 学习汇总
    java_时间戳与Date_相互转化的实现代码
    SparkML之推荐算法ALS
    ALS部署Spark集群入坑记
    test
    迁移数据库mysql
    JVM运行机制
  • 原文地址:https://www.cnblogs.com/jysun/p/3934502.html
Copyright © 2011-2022 走看看