一、簡介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
TracksPerCylinderio