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个数        

    }

  • 相关阅读:
    java TopK算法
    夫妻过河问题
    Java中数据存储分配
    STM32与ARM代码执行过程
    C中gets()函数与scanf()函数说明
    MRTG开源监控安装手册
    mysql笔记
    windows调用ubuntu下的sublimeText2环境搭建
    linux性能优化
    测试那些事儿—软测必备的Linux知识(一)
  • 原文地址:https://www.cnblogs.com/jysun/p/3934502.html
Copyright © 2011-2022 走看看