zoukankan      html  css  js  c++  java
  • C#中通过WMI的Win32_DiskDrive对象获取磁盘驱动器信息简介

    1、简介

         在WMI中,通过Win32_DiskDrive对象可以获取磁盘驱动器的相关信息:

          ManagementClass mc = new ManagementClass("Win32_DiskDrive");
          ManagementObjectCollection moc = mc.GetInstances();
          foreach (ManagementObject mo in moc)
          {
                propertyInfo = mo.Properties[PropertyName].Value.ToString();
          }


    2、属性名

         Win32_DiskDrive对象的属性名如下:

         Availability
         BytesPerSector
         Capabilities
         CapabilityDescriptions
         Caption
         CompressionMethod
         ConfigManagerErrorCode
         ConfigManagerUserConfig
         CreationClassName
         DefaultBlockSize
         Description
         DeviceID
         ErrorCleared
         ErrorDescription
         ErrorMethodology
         FirmwareRevision
         Index
         InstallDate
         InterfaceType
         LastErrorCode
         Manufacturer
         MaxBlockSize
         MaxMediaSize
         MediaLoaded
         MediaType
         MinBlockSize
         Model
         Name
         NeedsCleaning
         NumberOfMediaSupported
         Partitions
         PNPDeviceID
         PowerManagementCapabilities
         PowerManagementSupported
         SCSIBus
         SCSILogicalUnit
         SCSIPort
         SCSITargetId
         SectorsPerTrack
         SerialNumber
         Signature
         Size
         Status
         StatusInfo
         SystemCreationClassName
         SystemName
         TotalCylinders
         TotalHeads
         TotalSectors
         TotalTracks
         TracksPerCylinder

  • 相关阅读:
    十:Webpack 引入bootstrap
    九:Webpack结合ES6
    pfx格式密钥库修改密码
    邮件发送接收工具
    用keytool制作证书并在tomcat配置https服务(四)
    用keytool制作证书并在tomcat配置https服务(三)
    用keytool制作证书并在tomcat配置https服务(二 )
    用keytool制作证书并在tomcat配置https服务(一)
    java全角和半角转换
    RC4加密解密
  • 原文地址:https://www.cnblogs.com/JimZhang/p/3642682.html
Copyright © 2011-2022 走看看