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

  • 相关阅读:
    android 单位详解
    ViewFlipper的使用
    today is history,today is tomorrow
    Android2.1 和之后的版本 中的 drawable(hdpi,ldpi,mdpi) 的区别
    auto_ptr
    android编写Service入门
    Android程序完全退出的三种方法
    Android中Toast的用法简介
    安装android开发环境
    error C2850: 'PCH header file'
  • 原文地址:https://www.cnblogs.com/JimZhang/p/3642682.html
Copyright © 2011-2022 走看看