ASP。NET中如何读取服务器硬盘序列号,请大家帮忙

解决方案 »

  1.   

    http://community.csdn.net/Expert/TopicView3.asp?id=3390203
      

  2.   

    调用api函数GetVolumeInformation读取服务器硬盘序列号
      

  3.   

    楼主写 一个active X 在客户端调用嘛
      

  4.   

    介绍
    WMI就是Windows Management Instrumentation(Windows管理规范)。它是Windows中的一个核心管理技术。 
    WMI为访问大量的Windows管理数据和方法的提供了一个统一的机制。WMI通过脚本、C++程序接口、.NET类(系统管理)和命令行工具(WMIC)提供了对这个信息的访问。WMI的功能还包括事件、远程、查询、查看、计划和实施用户扩展及更多内容。 /// <summary>
    /// 得到服务器的硬盘型号
    /// </summary>
    public string GetHardId()
    {
    //得到服务器硬盘序列号
    string strHardInfo = "";
    ManagementClass cimObject = new ManagementClass("Win32_DiskDrive");
    ManagementObjectCollection mocHard = cimObject.GetInstances();
    foreach(ManagementObject moHard in mocHard)
    {
    strHardInfo += moHard["Model"].ToString() + "_";
    }
    return strHardInfo.Substring(0,strHardInfo.Length - 1);
    }