奇怪的工作,制作的是一款办公应用软件,领导却要求我统计用户计算机的物理信息,什么CPU的型号、核心数,什么内存信息等各种乱七八糟的用户信息。我想问,现在用户的信息就这么没有隐私性了么?想获取就获取传递到后台……无奈我只是民工,还是老老实实做了。然后查阅了一些资料,主要用到了System.Management命名空间下的信息(System.Management 命名空间 | Microsoft Docs)。

1、引用

  在查询计算机硬件或者操作系统的信息时,使用ManagementObjectSearcher类或者ManagementClass类,其在在System.Management命名空间下,需要添加对System.Management的引用。

  在日常的编程中,我们可以通过Environment获得一些简单的系统信息,如获得操作系统登录用户名:Environment.UserName。 但更多、复杂的信息并不能获得。

2、用法

  下面两部分代码分别演示获取操作系统信息:

  1、使用ManagementObjectSearcher类

  1. ObjectQuery query = new ObjectQuery("SELECT * FROM Win32_OperatingSystem");//注意查询的类型 from *
  2. ManagementObjectSearcher searcher =new ManagementObjectSearcher(query);//也可以直接将查询字符串写入这个构造函数中
  3. ManagementObjectCollection queryCollection = searcher.Get();
  4. foreach (ManagementObject m in queryCollection)
  5. {
  6. Console.WriteLine("Computer Name : {0}", m["csname"]);
  7. Console.WriteLine("Windows Directory : {0}", m["WindowsDirectory"]);
  8. Console.WriteLine("Operating System: {0}", m["Caption"]);
  9. Console.WriteLine("Version: {0}", m["Version"]);
  10. Console.WriteLine("Manufacturer : {0}", m["Manufacturer"]);
  11. }

  2、使用ManagementClass类

  1. ManagementClass mc = new ManagementClass("Win32_OperatingSystem");//填入需要查询的类型
  2. ManagementObjectCollection queryCollection = mc.GetInstances();
  3. foreach (ManagementObject m in queryCollection)
  4. {
  5. Console.WriteLine("Computer Name : {0}", m["csname"]);
  6. Console.WriteLine("Windows Directory : {0}", m["WindowsDirectory"]);
  7. Console.WriteLine("Operating System: {0}", m["Caption"]);
  8. Console.WriteLine("Version: {0}", m["Version"]);
  9. Console.WriteLine("Manufacturer : {0}", m["Manufacturer"]);
  10. }

  如果不知道要获取的属性名称,可以循环遍历打印出来(注意获取值的方式有两种)。

  1. ManagementClass mc = new ManagementClass("Win32_OperatingSystem");//填入需要查询的类型
  2. ManagementObjectCollection moc = mc.GetInstances();
  3. foreach (ManagementObject mo in moc)
  4. {
  5. foreach (PropertyData pd in mo.Properties)
  6. {
  7. if (mo[pd.Name] != null && mo[pd.Name].ToString() != "")
  8. {
  9. Console.WriteLine(string.Format("{0}:{1}", pd.Name, mo.GetPropertyValue(pd.Name)));
  10. }
  11. }
  12. }

3、示例

  以生成注册码为例,注册码使用CPU的序列号和C盘的序列号为基准:

  1. /// <summary>
  2. /// 获取CPU序列号
  3. /// </summary>
  4. /// <returns></returns>
  5. private string GetCpuNum()
  6. {
  7. ManagementClass mc = new ManagementClass("Win32_Processor");//填入需要查询的类型
  8. ManagementObjectCollection queryCollection = mc.GetInstances();
  9. foreach (ManagementObject m in queryCollection)
  10. {
  11. return m.GetPropertyValue("Processorid").ToString();
  12. }
  13. return string.Empty;
  14. }
  15.  
  16. /// <summary>
  17. /// 取得设备硬盘的卷标号
  18. /// </summary>
  19. /// <returns></returns>
  20. private Dictionary<string,string> GetDiskVolumeSerialNumber()
  21. {
  22. Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
  23.  
  24. ManagementClass mc = new ManagementClass("Win32_LogicalDisk");//填入需要查询的类型
  25. ManagementObjectCollection queryCollection = mc.GetInstances();
  26. foreach (ManagementObject mo in queryCollection)
  27. {
  28. keyValuePairs.Add(mo.GetPropertyValue("DeviceID").ToString().Trim(':'), mo.GetPropertyValue("VolumeSerialNumber").ToString());
  29. }
  30. return keyValuePairs;
  31. }
  32. ///<summary>
  33. ///生成注册码
  34. ///</summary>
  35. ///<returns></returns>
  36. public string GetRegCode()
  37. {
  38. int[] intCode = new int[127];//存储密钥
  39. int[] intNumber = new int[25];//存机器码的Ascii值
  40. char[] Charcode = new char[25];//存储机器码字
  41. //初始化127位数组
  42. for (int i = 1; i < intCode.Length; i++)
  43. {
  44. intCode[i] = i % 9;
  45. }
  46. string cpuNum = GetCpuNum();
  47. string diskSerialNumber = GetDiskVolumeSerialNumber()["C"];
  48. string strNum = cpuNum + diskSerialNumber;//生成机器码
  49. string MNum = strNum.Substring(0, 24);//从生成的字符串中取出前24个字符做为机器码
  50. for (int i = 1; i < Charcode.Length; i++)//把机器码存入数组中
  51. {
  52. Charcode[i] = Convert.ToChar(MNum.Substring(i - 1, 1));
  53.  
  54. }
  55. for (int j = 1; j < intNumber.Length; j++)//把字符的ASCII值存入一个整数组中。
  56. {
  57. intNumber[j] = intCode[Convert.ToInt32(Charcode[j])] + Convert.ToInt32(Charcode[j]);
  58. }
  59. string strAsciiName = "";//用于存储注册码
  60. for (int j = 1; j < intNumber.Length; j++)
  61. {
  62. if (intNumber[j] >= 48 && intNumber[j] <= 57)//判断字符ASCII值是否0-9之间
  63. {
  64. strAsciiName += Convert.ToChar(intNumber[j]).ToString();
  65. }
  66. else if (intNumber[j] >= 65 && intNumber[j] <= 90)//判断字符ASCII值是否A-Z之间
  67. {
  68. strAsciiName += Convert.ToChar(intNumber[j]).ToString();
  69. }
  70. else if (intNumber[j] >= 97 && intNumber[j] <= 122)//判断字符ASCII值是否a-z之间
  71. {
  72. strAsciiName += Convert.ToChar(intNumber[j]).ToString();
  73. }
  74. else//判断字符ASCII值不在以上范围内
  75. {
  76. if (intNumber[j] > 122)//判断字符ASCII值是否大于z
  77. {
  78. strAsciiName += Convert.ToChar(intNumber[j] - 10).ToString();
  79. }
  80. else
  81. {
  82. strAsciiName += Convert.ToChar(intNumber[j] - 9).ToString();
  83. }
  84. }
  85. }
  86. return strAsciiName;//返回注册码
  87. }

4、常用的Key

  ObjectQuery和ManagementClass都需要输入Key值,以明确需要获取什么类型的数据。其常用的Key值如下:

  1. internal enum WmiType
  2. {
  3. Win32_Processor, // CPU 处理器
  4. Win32_PhysicalMemory, // 物理内存条
  5. Win32_Keyboard, // 键盘
  6. Win32_PointingDevice, // 点输入设备,包括鼠标。
  7. Win32_FloppyDrive, // 软盘驱动器
  8. Win32_DiskDrive, // 硬盘驱动器
  9. Win32_CDROMDrive, // 光盘驱动器
  10. Win32_BaseBoard, // 主板
  11. Win32_BIOS, // BIOS 芯片
  12. Win32_ParallelPort, // 并口
  13. Win32_SerialPort, // 串口
  14. Win32_SerialPortConfiguration, // 串口配置
  15. Win32_SoundDevice, // 多媒体设置,一般指声卡。
  16. Win32_SystemSlot, // 主板插槽 (ISA & PCI & AGP)
  17. Win32_USBController, // USB 控制器
  18. Win32_NetworkAdapter, // 网络适配器
  19. Win32_NetworkAdapterConfiguration, // 网络适配器设置
  20. Win32_Printer, // 打印机
  21. Win32_PrinterConfiguration, // 打印机设置
  22. Win32_PrintJob, // 打印机任务
  23. Win32_TCPIPPrinterPort, // 打印机端口
  24. Win32_POTSModem, // MODEM
  25. Win32_POTSModemToSerialPort, // MODEM 端口
  26. Win32_DesktopMonitor, // 显示器
  27. Win32_DisplayConfiguration, // 显卡
  28. Win32_DisplayControllerConfiguration, // 显卡设置
  29. Win32_VideoController, // 显卡细节。
  30. Win32_VideoSettings, // 显卡支持的显示模式。
  31.  
  32. // 操作系统
  33. Win32_TimeZone, // 时区
  34. Win32_SystemDriver, // 驱动程序
  35. Win32_DiskPartition, // 磁盘分区
  36. Win32_LogicalDisk, // 逻辑磁盘
  37. Win32_LogicalDiskToPartition, // 逻辑磁盘所在分区及始末位置。
  38. Win32_LogicalMemoryConfiguration, // 逻辑内存配置
  39. Win32_PageFile, // 系统页文件信息
  40. Win32_PageFileSetting, // 页文件设置
  41. Win32_BootConfiguration, // 系统启动配置
  42. Win32_ComputerSystem, // 计算机信息简要
  43. Win32_OperatingSystem, // 操作系统信息
  44. Win32_StartupCommand, // 系统自动启动程序
  45. Win32_Service, // 系统安装的服务
  46. Win32_Group, // 系统管理组
  47. Win32_GroupUser, // 系统组帐号
  48. Win32_UserAccount, // 用户帐号
  49. Win32_Process, // 系统进程
  50. Win32_Thread, // 系统线程
  51. Win32_Share, // 共享
  52. Win32_NetworkClient, // 已安装的网络客户端
  53. Win32_NetworkProtocol, // 已安装的网络协议
  54. }

5、全部Key值

  1. internal enum WmiType
  2. {
  3.  
  4. Win32_1394Controller,
  5. Win32_1394ControllerDevice,
  6. Win32_Account,
  7. Win32_AccountSID,
  8. Win32_ACE,
  9. Win32_ActionCheck,
  10. Win32_AllocatedResource,
  11. Win32_ApplicationCommandLine,
  12. Win32_ApplicationService,
  13. Win32_AssociatedBattery,
  14. Win32_AssociatedProcessorMemory,
  15. Win32_BaseBoard,
  16. Win32_BaseService,
  17. Win32_Battery,
  18. Win32_Binary,
  19. Win32_BindImageAction,
  20. Win32_BIOS,
  21. Win32_BootConfiguration,
  22. Win32_Bus,
  23. Win32_CacheMemory,
  24. Win32_CDROMDrive,
  25. Win32_CheckCheck,
  26. Win32_CIMLogicalDeviceCIMDataFile,
  27. Win32_ClassicCOMApplicationClasses,
  28. Win32_ClassicCOMClass,
  29. Win32_ClassicCOMClassSetting,
  30. Win32_ClassicCOMClassSettings,
  31. Win32_ClassInfoAction,
  32. Win32_ClientApplicationSetting,
  33. Win32_CodecFile,
  34. Win32_COMApplication,
  35. Win32_COMApplicationClasses,
  36. Win32_COMApplicationSettings,
  37. Win32_COMClass,
  38. Win32_ComClassAutoEmulator,
  39. Win32_ComClassEmulator,
  40. Win32_CommandLineAccess,
  41. Win32_ComponentCategory,
  42. Win32_ComputerSystem,
  43. Win32_ComputerSystemProcessor,
  44. Win32_ComputerSystemProduct,
  45. Win32_COMSetting,
  46. Win32_Condition,
  47. Win32_CreateFolderAction,
  48. Win32_CurrentProbe,
  49. Win32_DCOMApplication,
  50. Win32_DCOMApplicationAccessAllowedSetting,
  51. Win32_DCOMApplicationLaunchAllowedSetting,
  52. Win32_DCOMApplicationSetting,
  53. Win32_DependentService,
  54. Win32_Desktop,
  55. Win32_DesktopMonitor,
  56. Win32_DeviceBus,
  57. Win32_DeviceMemoryAddress,
  58. Win32_DeviceSettings,
  59. Win32_Directory,
  60. Win32_DirectorySpecification,
  61. Win32_DiskDrive,
  62. Win32_DiskDriveToDiskPartition,
  63. Win32_DiskPartition,
  64. Win32_DisplayConfiguration,
  65. Win32_DisplayControllerConfiguration,
  66. Win32_DMAChannel,
  67. Win32_DriverVXD,
  68. Win32_DuplicateFileAction,
  69. Win32_Environment,
  70. Win32_EnvironmentSpecification,
  71. Win32_ExtensionInfoAction,
  72. Win32_Fan,
  73. Win32_FileSpecification,
  74. Win32_FloppyController,
  75. Win32_FloppyDrive,
  76. Win32_FontInfoAction,
  77. Win32_Group,
  78. Win32_GroupUser,
  79. Win32_HeatPipe,
  80. Win32_IDEController,
  81. Win32_IDEControllerDevice,
  82. Win32_ImplementedCategory,
  83. Win32_InfraredDevice,
  84. Win32_IniFileSpecification,
  85. Win32_InstalledSoftwareElement,
  86. Win32_IRQResource,
  87. Win32_Keyboard,
  88. Win32_LaunchCondition,
  89. Win32_LoadOrderGroup,
  90. Win32_LoadOrderGroupServiceDependencies,
  91. Win32_LoadOrderGroupServiceMembers,
  92. Win32_LogicalDisk,
  93. Win32_LogicalDiskRootDirectory,
  94. Win32_LogicalDiskToPartition,
  95. Win32_LogicalFileAccess,
  96. Win32_LogicalFileAuditing,
  97. Win32_LogicalFileGroup,
  98. Win32_LogicalFileOwner,
  99. Win32_LogicalFileSecuritySetting,
  100. Win32_LogicalMemoryConfiguration,
  101. Win32_LogicalProgramGroup,
  102. Win32_LogicalProgramGroupDirectory,
  103. Win32_LogicalProgramGroupItem,
  104. Win32_LogicalProgramGroupItemDataFile,
  105. Win32_LogicalShareAccess,
  106. Win32_LogicalShareAuditing,
  107. Win32_LogicalShareSecuritySetting,
  108. Win32_ManagedSystemElementResource,
  109. Win32_MemoryArray,
  110. Win32_MemoryArrayLocation,
  111. Win32_MemoryDevice,
  112. Win32_MemoryDeviceArray,
  113. Win32_MemoryDeviceLocation,
  114. Win32_MethodParameterClass,
  115. Win32_MIMEInfoAction,
  116. Win32_MotherboardDevice,
  117. Win32_MoveFileAction,
  118. Win32_MSIResource,
  119. Win32_NetworkAdapter,
  120. Win32_NetworkAdapterConfiguration,
  121. Win32_networkAdapterSetting,
  122. Win32_NetworkClient,
  123. Win32_networkConnection,
  124. Win32_NetworkLoginProfile,
  125. Win32_NetworkProtocol,
  126. Win32_NTEventlogFile,
  127. Win32_NTLogEvent,
  128. Win32_NTLogEventComputer,
  129. Win32_NTLogEventLog,
  130. Win32_NTLogEventUser,
  131. Win32_ODBCAttribute,
  132. Win32_ODBCDataSourceAttribute,
  133. Win32_ODBCDataSourceSpecification,
  134. Win32_ODBCDriverAttribute,
  135. Win32_ODBCDriverSoftwareElement,
  136. Win32_ODBCDriverSpecification,
  137. Win32_ODBCSourceAttribute,
  138. Win32_ODBCTranslatorSpecification,
  139. Win32_OnBoardDevice,
  140. Win32_OperatingSystem,
  141. Win32_OperatingSystemQFE,
  142. Win32_OSRecoveryConfiguration,
  143. Win32_PageFile,
  144. Win32_PageFileElementSetting,
  145. Win32_PageFileSetting,
  146. Win32_PageFileUsage,
  147. Win32_ParallelPort,
  148. Win32_Patch,
  149. Win32_PatchFile,
  150. Win32_PatchPackage,
  151. Win32_PCMCIAController,
  152. Win32_Perf,
  153. Win32_PerfRawData,
  154. Win32_PerfRawData_ASP_ActiveServerPages,
  155. Win32_PerfRawData_ASPnet_114322_ASPnetAppsv114322,
  156. Win32_PerfRawData_ASPnet_114322_ASPnetv114322,
  157. Win32_PerfRawData_ASPnet_ASPnet,
  158. Win32_PerfRawData_ASPnet_ASPnetApplications,
  159. Win32_PerfRawData_IAS_IASAccountingClients,
  160. Win32_PerfRawData_IAS_IASAccountingServer,
  161. Win32_PerfRawData_IAS_IASAuthenticationClients,
  162. Win32_PerfRawData_IAS_IASAuthenticationServer,
  163. Win32_PerfRawData_InetInfo_InternetInformationServicesGlobal,
  164. Win32_PerfRawData_MSDTC_DistributedTransactionCoordinator,
  165. Win32_PerfRawData_MSFTPSVC_FTPService,
  166. Win32_PerfRawData_MSSQLSERVER_SQLServerAccessMethods,
  167. Win32_PerfRawData_MSSQLSERVER_SQLServerBackupDevice,
  168. Win32_PerfRawData_MSSQLSERVER_SQLServerBufferManager,
  169. Win32_PerfRawData_MSSQLSERVER_SQLServerBufferPartition,
  170. Win32_PerfRawData_MSSQLSERVER_SQLServerCacheManager,
  171. Win32_PerfRawData_MSSQLSERVER_SQLServerDatabases,
  172. Win32_PerfRawData_MSSQLSERVER_SQLServerGeneralStatistics,
  173. Win32_PerfRawData_MSSQLSERVER_SQLServerLatches,
  174. Win32_PerfRawData_MSSQLSERVER_SQLServerLocks,
  175. Win32_PerfRawData_MSSQLSERVER_SQLServerMemoryManager,
  176. Win32_PerfRawData_MSSQLSERVER_SQLServerReplicationAgents,
  177. Win32_PerfRawData_MSSQLSERVER_SQLServerReplicationDist,
  178. Win32_PerfRawData_MSSQLSERVER_SQLServerReplicationLogreader,
  179. Win32_PerfRawData_MSSQLSERVER_SQLServerReplicationMerge,
  180. Win32_PerfRawData_MSSQLSERVER_SQLServerReplicationSnapshot,
  181. Win32_PerfRawData_MSSQLSERVER_SQLServerSQLStatistics,
  182. Win32_PerfRawData_MSSQLSERVER_SQLServerUserSettable,
  183. Win32_PerfRawData_netFramework_netCLRExceptions,
  184. Win32_PerfRawData_netFramework_netCLRInterop,
  185. Win32_PerfRawData_netFramework_netCLRJit,
  186. Win32_PerfRawData_netFramework_netCLRLoading,
  187. Win32_PerfRawData_netFramework_netCLRLocksAndThreads,
  188. Win32_PerfRawData_netFramework_netCLRMemory,
  189. Win32_PerfRawData_netFramework_netCLRRemoting,
  190. Win32_PerfRawData_netFramework_netCLRSecurity,
  191. Win32_PerfRawData_Outlook_Outlook,
  192. Win32_PerfRawData_PerfDisk_PhysicalDisk,
  193. Win32_PerfRawData_Perfnet_Browser,
  194. Win32_PerfRawData_Perfnet_Redirector,
  195. Win32_PerfRawData_Perfnet_Server,
  196. Win32_PerfRawData_Perfnet_ServerWorkQueues,
  197. Win32_PerfRawData_PerfOS_Cache,
  198. Win32_PerfRawData_PerfOS_Memory,
  199. Win32_PerfRawData_PerfOS_Objects,
  200. Win32_PerfRawData_PerfOS_PagingFile,
  201. Win32_PerfRawData_PerfOS_Processor,
  202. Win32_PerfRawData_PerfOS_System,
  203. Win32_PerfRawData_PerfProc_FullImage_Costly,
  204. Win32_PerfRawData_PerfProc_Image_Costly,
  205. Win32_PerfRawData_PerfProc_JobObject,
  206. Win32_PerfRawData_PerfProc_JobObjectDetails,
  207. Win32_PerfRawData_PerfProc_Process,
  208. Win32_PerfRawData_PerfProc_ProcessAddressSpace_Costly,
  209. Win32_PerfRawData_PerfProc_Thread,
  210. Win32_PerfRawData_PerfProc_ThreadDetails_Costly,
  211. Win32_PerfRawData_RemoteAccess_RASPort,
  212. Win32_PerfRawData_RemoteAccess_RASTotal,
  213. Win32_PerfRawData_RSVP_ACSPerRSVPService,
  214. Win32_PerfRawData_Spooler_PrintQueue,
  215. Win32_PerfRawData_TapiSrv_Telephony,
  216. Win32_PerfRawData_Tcpip_ICMP,
  217. Win32_PerfRawData_Tcpip_IP,
  218. Win32_PerfRawData_Tcpip_NBTConnection,
  219. Win32_PerfRawData_Tcpip_networkInterface,
  220. Win32_PerfRawData_Tcpip_TCP,
  221. Win32_PerfRawData_Tcpip_UDP,
  222. Win32_PerfRawData_W3SVC_WebService,
  223. Win32_PhysicalMedia,
  224. Win32_PhysicalMemory,
  225. Win32_PhysicalMemoryArray,
  226. Win32_PhysicalMemoryLocation,
  227. Win32_PNPAllocatedResource,
  228. Win32_PnPDevice,
  229. Win32_PnPEntity,
  230. Win32_PointingDevice,
  231. Win32_PortableBattery,
  232. Win32_PortConnector,
  233. Win32_PortResource,
  234. Win32_POTSModem,
  235. Win32_POTSModemToSerialPort,
  236. Win32_PowerManagementEvent,
  237. Win32_Printer,
  238. Win32_PrinterConfiguration,
  239. Win32_PrinterController,
  240. Win32_PrinterDriverDll,
  241. Win32_PrinterSetting,
  242. Win32_PrinterShare,
  243. Win32_PrintJob,
  244. Win32_PrivilegesStatus,
  245. Win32_Process,
  246. Win32_Processor,
  247. Win32_ProcessStartup,
  248. Win32_Product,
  249. Win32_ProductCheck,
  250. Win32_ProductResource,
  251. Win32_ProductSoftwareFeatures,
  252. Win32_ProgIDSpecification,
  253. Win32_ProgramGroup,
  254. Win32_ProgramGroupContents,
  255. Win32_ProgramGroupOrItem,
  256. Win32_Property,
  257. Win32_ProtocolBinding,
  258. Win32_PublishComponentAction,
  259. Win32_QuickFixEngineering,
  260. Win32_Refrigeration,
  261. Win32_Registry,
  262. Win32_RegistryAction,
  263. Win32_RemoveFileAction,
  264. Win32_RemoveIniAction,
  265. Win32_ReserveCost,
  266. Win32_ScheduledJob,
  267. Win32_SCSIController,
  268. Win32_SCSIControllerDevice,
  269. Win32_SecurityDescriptor,
  270. Win32_SecuritySetting,
  271. Win32_SecuritySettingAccess,
  272. Win32_SecuritySettingAuditing,
  273. Win32_SecuritySettingGroup,
  274. Win32_SecuritySettingOfLogicalFile,
  275. Win32_SecuritySettingOfLogicalShare,
  276. Win32_SecuritySettingOfObject,
  277. Win32_SecuritySettingOwner,
  278. Win32_SelfRegModuleAction,
  279. Win32_SerialPort,
  280. Win32_SerialPortConfiguration,
  281. Win32_SerialPortSetting,
  282. Win32_Service,
  283. Win32_ServiceControl,
  284. Win32_ServiceSpecification,
  285. Win32_ServiceSpecificationService,
  286. Win32_SettingCheck,
  287. Win32_Share,
  288. Win32_ShareToDirectory,
  289. Win32_ShortcutAction,
  290. Win32_ShortcutFile,
  291. Win32_ShortcutSAP,
  292. Win32_SID,
  293. Win32_SMBIOSMemory,
  294. Win32_SoftwareElement,
  295. Win32_SoftwareElementAction,
  296. Win32_SoftwareElementCheck,
  297. Win32_SoftwareElementCondition,
  298. Win32_SoftwareElementResource,
  299. Win32_SoftwareFeature,
  300. Win32_SoftwareFeatureAction,
  301. Win32_SoftwareFeatureCheck,
  302. Win32_SoftwareFeatureParent,
  303. Win32_SoftwareFeatureSoftwareElements,
  304. Win32_SoundDevice,
  305. Win32_StartupCommand,
  306. Win32_SubDirectory,
  307. Win32_SystemAccount,
  308. Win32_SystemBIOS,
  309. Win32_SystemBootConfiguration,
  310. Win32_SystemDesktop,
  311. Win32_SystemDevices,
  312. Win32_SystemDriver,
  313. Win32_SystemDriverPNPEntity,
  314. Win32_SystemEnclosure,
  315. Win32_SystemLoadOrderGroups,
  316. Win32_SystemLogicalMemoryConfiguration,
  317. Win32_SystemMemoryResource,
  318. Win32_SystemnetworkConnections,
  319. Win32_SystemOperatingSystem,
  320. Win32_SystemPartitions,
  321. Win32_SystemProcesses,
  322. Win32_SystemProgramGroups,
  323. Win32_SystemResources,
  324. Win32_SystemServices,
  325. Win32_SystemSetting,
  326. Win32_SystemSlot,
  327. Win32_SystemSystemDriver,
  328. Win32_SystemTimeZone,
  329. Win32_SystemUsers,
  330. Win32_TCPIPPrinterPort,
  331. Win32_TapeDrive,
  332. Win32_TemperatureProbe,
  333. Win32_Thread,
  334. Win32_TimeZone,
  335. Win32_Trustee,
  336. Win32_TypeLibraryAction,
  337. Win32_UninterruptiblePowerSupply,
  338. Win32_USBController,
  339. Win32_USBControllerDevice,
  340. Win32_UserAccount,
  341. Win32_UserDesktop,
  342. Win32_VideoConfiguration,
  343. Win32_VideoController,
  344. Win32_VideoSettings,
  345. Win32_VoltageProbe,
  346. Win32_WMIElementSetting,
  347. Win32_WMISetting,
  348. }

全部key值

获取windows 操作系统下的硬件或操作系统信息等的更多相关文章

  1. 反射实现Model修改前后的内容对比 【API调用】腾讯云短信 Windows操作系统下Redis服务安装图文详解 Redis入门学习

    反射实现Model修改前后的内容对比   在开发过程中,我们会遇到这样一个问题,编辑了一个对象之后,我们想要把这个对象修改了哪些内容保存下来,以便将来查看和追责. 首先我们要创建一个User类 1 p ...

  2. Windows操作系统下远程连接MySQL数据库

    用Eclipse做一个后台项目,但是数据库不想放在本地电脑,于是买了一个腾讯云服务器(学生有优惠,挺便宜的),装上MySQL数据库,但是测试连接的时候,发现总是连接不是上,但是本地数据库可以连接,于是 ...

  3. 获取Windows服务下当前路径的方法

    获取Windows服务下当前路径的方法 获取当前运行程序路径 包含exe Assembly.GetExecutingAssembly().Location; D:\xxxxxx\bin\Debug\x ...

  4. Windows操作系统下搭建Git服务器和客户端。

    本文将介绍如何在Windows操作系统下搭建Git服务器和客户端.服务器端采用的是Bonobo Git Server,一款用ASP.NET MVC开发的Git源代码管理工具,界面简洁,基于Web方式配 ...

  5. Windows操作系统下SVN无法上传*.o文件

    Windows操作系统下SVN无法上传*.o文件 2017年09月07日 10:14:49 yanlaifan 阅读数:834  摘自:https://blog.csdn.net/yanlaifan/ ...

  6. [学习分享] 在Windows操作系统下如何安装RMySQL包

    最近在做股票的高频交易数据分析,需要用到数据库,而我只对MySQL比较熟悉,于是就安装了MySQL.当我安装好了MySQL后,正兴冲冲地准备安装RMySQL包时,问题来了:RMySQL包不支持wind ...

  7. 获取Windows平台下 安装office 版本位数信息

    最近在处理客户端安装程序过程,有一个需求:需要检测Windows平台下安装office 版本信息以及获取使用的office是32 位还是64 位: 当检测出office 位数为64位时,提示当前off ...

  8. 简单对比一下不同Windows操作系统在相同硬件配置的情况下浏览器js引擎的性能

    最近部门进行Windows客户端的测试产品单点性能, 感觉不在通的windows版本以及浏览器内核的情况下性能可能有差异, 也一直没有找到一个比较好的对比工具, 今天用chrome的控制台简单测试了下 ...

  9. Windows操作系统下安装Ubuntu虚拟机

    认识VMware虚拟机 VMware(虚拟机)是指通过软件模拟的具有完整硬件系统功能的.运行在一个完全隔离环境中的完整计算机系统,它能在Windows系统上虚拟出多个计算机,每个虚拟计算机可以独立运行 ...

随机推荐

  1. CosId 1.0.0 发布,通用、灵活、高性能的分布式 ID 生成器

    CosId 通用.灵活.高性能的分布式 ID 生成器 介绍 CosId 旨在提供通用.灵活.高性能的分布式系统 ID 生成器. 目前提供了俩大类 ID 生成器:SnowflakeId (单机 TPS ...

  2. Kubernetes网络的iptables模式和ipvs模式支持ping分析

    1.iptables模式无法ping通原因分析 iptables模式下,无法ping通任何svc,包括clusterip.所有ns下,下面来分析原因: 查看kubernetes的网络模式 curl 1 ...

  3. 4.QT:spinbox(spindoublebox)控件的信号响应

    Qt的QSpinBox和QDoubleSpinBox两个控件在默认情况下是valueChanged信号,会响应每次输入栏的改变. 比如想要输入数值"123",我们会依次键入1 - ...

  4. 基于xtrabackup的主从同步

    基于xtrabackup的主从同步 作者 刘畅 时间 2020-9-21 服务器版本:CentOS Linux release 7.5.1804 主机名 ip地址 服务器配置 安装软件 密码 mysq ...

  5. 关于asp.net中Repeater控件的一些应用

    在Asp.net中,我是比较喜欢用Repeater这个控件,刚刚遇到的一个问题,怎么实现单击 <asp:LinkButton>,通过后台的单击事件获取同一行数据中的其他数据(对象). 1, ...

  6. Nginx:Nginx日志切割方法

    Nginx的日志文件是没有切割(rotate)功能的,但是我们可以写一个脚本来自动切割日志文件. 首先我们要注意两点: 1.切割的日志文件是不重名的,所以需要我们自定义名称,一般就是时间日期做文件名. ...

  7. hadoop学习(三)HDFS常用命令以及java操作HDFS

    一.HDFS的常用命令 1.查看根目录下的信息:./hadoop dfs -ls 2.查看根目录下的in目录中的内容:./hadoop dfs -ls in或者./hadoop dfs -ls ./i ...

  8. 【转载】每天一个linux命令(11):nl命令

    转载至:http://www.cnblogs.com/peida/archive/2012/11/01/2749048.html nl命令在linux系统中用来计算文件中行号.nl 可以将输出的文件内 ...

  9. 架构之:REST和RESTful

    目录 简介 REST REST和RESTful API REST架构的基本原则 Uniform interface统一的接口 Client–server 客户端和服务器端独立 Stateless无状态 ...

  10. python django与celery的集成

    一.celery与django 关于celery介绍和使用可以查看上篇Python中任务队列-芹菜celery的使用 关于django的介绍和使用可查看python django框架+vue.js前后 ...