通过WMI中的Win32_OperatingSystem类一样可以获取到相关的操作系统信息,与System.Evnironment类暂未做比对
类中属性
http://msdn.microsoft.com/en-us/library/aa394239(VS.85).aspx
类中属性
http://msdn.microsoft.com/en-us/library/aa394239(VS.85).aspx
class Win32_OperatingSystem : CIM_OperatingSystem
{
string BootDevice;
string BuildNumber;
string BuildType;
string Caption;
string CodeSet;
string CountryCode;
string CreationClassName;
string CSCreationClassName;
string CSDVersion;
string CSName;
sint16 CurrentTimeZone;
boolean DataExecutionPrevention_Available;
boolean DataExecutionPrevention_32BitApplications;
boolean DataExecutionPrevention_Drivers;
uint8 DataExecutionPrevention_SupportPolicy;
boolean Debug;
string Description;
boolean Distributed;
uint32 EncryptionLevel;
uint8 ForegroundApplicationBoost;
uint64 FreePhysicalMemory;
uint64 FreeSpaceInPagingFiles;
uint64 FreeVirtualMemory;
datetime InstallDate;
uint32 LargeSystemCache;
datetime LastBootUpTime;
datetime LocalDateTime;
string Locale;
string Manufacturer;
uint32 MaxNumberOfProcesses;
uint64 MaxProcessMemorySize;
string MUILanguages[];
string Name;
uint32 NumberOfLicensedUsers;
uint32 NumberOfProcesses;
uint32 NumberOfUsers;
uint32 OperatingSystemSKU;
string Organization;
string OSArchitecture;
uint32 OSLanguage;
uint32 OSProductSuite;
uint16 OSType;
string OtherTypeDescription;
Boolean PAEEnabled;
string PlusProductID;
string PlusVersionNumber;
boolean Primary;
uint32 ProductType;
string RegisteredUser;
string SerialNumber;
uint16 ServicePackMajorVersion;
uint16 ServicePackMinorVersion;
uint64 SizeStoredInPagingFiles;
string Status;
uint32 SuiteMask;
string SystemDevice;
string SystemDirectory;
string SystemDrive;
uint64 TotalSwapSpaceSize;
uint64 TotalVirtualMemorySize;
uint64 TotalVisibleMemorySize;
string Version;
string WindowsDirectory;
};
通过构建WMI程序获取相关信息,其中需要用到ManagementClass类,其相关描述为:{
string BootDevice;
string BuildNumber;
string BuildType;
string Caption;
string CodeSet;
string CountryCode;
string CreationClassName;
string CSCreationClassName;
string CSDVersion;
string CSName;
sint16 CurrentTimeZone;
boolean DataExecutionPrevention_Available;
boolean DataExecutionPrevention_32BitApplications;
boolean DataExecutionPrevention_Drivers;
uint8 DataExecutionPrevention_SupportPolicy;
boolean Debug;
string Description;
boolean Distributed;
uint32 EncryptionLevel;
uint8 ForegroundApplicationBoost;
uint64 FreePhysicalMemory;
uint64 FreeSpaceInPagingFiles;
uint64 FreeVirtualMemory;
datetime InstallDate;
uint32 LargeSystemCache;
datetime LastBootUpTime;
datetime LocalDateTime;
string Locale;
string Manufacturer;
uint32 MaxNumberOfProcesses;
uint64 MaxProcessMemorySize;
string MUILanguages[];
string Name;
uint32 NumberOfLicensedUsers;
uint32 NumberOfProcesses;
uint32 NumberOfUsers;
uint32 OperatingSystemSKU;
string Organization;
string OSArchitecture;
uint32 OSLanguage;
uint32 OSProductSuite;
uint16 OSType;
string OtherTypeDescription;
Boolean PAEEnabled;
string PlusProductID;
string PlusVersionNumber;
boolean Primary;
uint32 ProductType;
string RegisteredUser;
string SerialNumber;
uint16 ServicePackMajorVersion;
uint16 ServicePackMinorVersion;
uint64 SizeStoredInPagingFiles;
string Status;
uint32 SuiteMask;
string SystemDevice;
string SystemDirectory;
string SystemDrive;
uint64 TotalSwapSpaceSize;
uint64 TotalVirtualMemorySize;
uint64 TotalVisibleMemorySize;
string Version;
string WindowsDirectory;
};
ManagementClass 类(http://msdn.microsoft.com/zh-cn/library/system.management.managementclass(VS.80).aspx)
表示公共信息模型 (CIM) 管理类。管理类是一个 WMI 类,如 Win32_LogicalDisk 和 Win32_Process,前者表示磁盘驱动器,后者表示进程(如 Notepad.exe)。通过该类的成员,可以使用特定的 WMI 类路径访问 WMI 数据。
Code