c# WMI

using System.Management;

(system.management.dll)

public class SystemInfo
    {
        public string GetCPUId()
        {
            ManagementClass mClass = new ManagementClass("Win32_Processor");
            ManagementObjectCollection moc = mClass.GetInstances();
            string cpuId = null;
            foreach (ManagementObject mo in moc)
            {
                cpuId = mo.Properties["ProcessorId"].Value.ToString();
                break;
            }
            return cpuId;
        }
    }

 

Hard
Win32_Processor      CPU
Win32_PhysicalMemory     Memory
Win32_Keyboard      Keyboard
Win32_PointingDevice     mouse
Win32_FloppyDrve     Floppy
Win32_DiskDrive      Disk
Win32_CDROMDrive     CD
Win32_BaseBoard      Board
Win32_BIOS      BIOS
Win32_ParallelPort     ParallelPort
Win32_SerialPort     SerialPort
Win32_SerialPortConfiguration    SerialPortConfiguration
Win32_SoundDevice     SoundCard
Win32_SystemSlot     ISA PCI AGP
Win32_USBController     USB
Win32_NetworkAdapter     NetAdapter
Win32_NetworkAdapterConfiguration   Network
Win32_Printer      Printer
Win32_PrinterConfiguration    PrinterConfiguration
Win32_PrintJob      PrintJob
Win32_TCPIPPrinterPort     PrintPort
Win32_POSTModem      MODEM
Win32_POSTModemToSerialPort    MODEM Port
Win32_DesktopMonitor     Display Monitor
Win32_DisplayConfiguration    Display Card
Win32_DisplayControllerConfiguration   Display Card Configuration
Win32_VideoController     DisPlay Detail
Win32_VideoSettings     Video support settings

OS
Win32_TimeZone      timezone
Win32_SystemDriver     Driver App
Win32_DiskPartition     Disk partition
Win32_LogicalDisk     logical disk
Win32_LogicalDiskToPartition    disk location
Win32_LogicalDiskMemoryConfiguration   logic memory configuration
Win32_PageFile      page information
Win32_PageFileSetting     page setting
Win32_BootConfiguration     boot configuration
Win32_ComputerSystem     OS summary
Win32_OperatingSystem     OS information
Win32_StartupCommand     Startup command
Win32_Service      Service
Win32_Group      Group
Win32_GroupUser      Group user
Win32_UserAccount     account
Win32_Process      process
Win32_Thread      thread
Win32_Share      share
Win32_NetworkClient     installed network client
Win32_NetworkProtocol     installed network protocol

 

 

 

 

 

 

 

 

 

 

 

from  http://hi.baidu.com/jackeyrain/blog/item/43e921f887557a1fd9f9fdbc.html

 

thank you ,jackeyrain

 

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(thread,C++,c,C#,OS)