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

    }

  • 相关阅读:
    Android view显示在软键盘上方
    ListView子项点击无反应的解决办法
    adb for mac
    Android文件的流操作工具类
    Linux之间配置SSH互信(SSH免密码登录)
    最简单的Linux虚拟机磁盘扩容方法
    Grunt + Bower—前端构建利器
    Microsoft Office 2016 简体中文 Vol 版镜像下载(Pro Plus、Visio、Project 下载)
    如何在windows下安装GIT
    如何在Crystal框架项目中内置启动MetaQ服务?
  • 原文地址:https://www.cnblogs.com/jysun/p/3934502.html
Copyright © 2011-2022 走看看