C#中经过WMI的Win32_DiskDrive对象获取磁盘驱动器信息简介

一、简介spa

     在WMI中,经过Win32_DiskDrive对象能够获取磁盘驱动器的相关信息:对象

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


二、属性名get

     Win32_DiskDrive对象的属性名以下:it

     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
io

相关文章
相关标签/搜索