ImageVerifierCode 换一换
格式:DOCX , 页数:16 ,大小:19.29KB ,
资源ID:23812616      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/23812616.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(WMI获取系统硬件信息.docx)为本站会员(b****8)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

WMI获取系统硬件信息.docx

1、WMI获取系统硬件信息WMI是英文Windows Management Instrumentation的简写,它的功能主要是:访问本地主机的一些信息和服务,可以管理远程计算机(当然你必须要拥有足够的权限),比如:重启,关机,关闭进程,创建进程等。 实例如下:用WMI,先工程-引用 Microsoft WMI Scripting V1.1 Library获取显卡/声卡/内存/操作系统的信息声卡信息Private Sub wmiSoundDeviceInfo()Dim wmiObjSet As SWbemObjectSetDim obj As SWbemObjectSet wmiObjSet =

2、GetObject(winmgmts:impersonationLevel=impersonate). _InstancesOf(Win32_SoundDevice)On Local Error Resume NextFor Each obj In wmiObjSetMsgBox obj.ProductNameNextEnd Sub显卡信息Private Sub wmiVideoControllerInfo()Dim wmiObjSet As SWbemObjectSetDim obj As SWbemObjectSet wmiObjSet = GetObject(winmgmts:imper

3、sonationLevel=impersonate). _InstancesOf(Win32_VideoController)On Local Error Resume NextFor Each obj In wmiObjSetMsgBox obj.VideoProcessorNextEnd Sub内存信息Private Sub wmiPhysicalMemoryInfo()Dim wmiObjSet As SWbemObjectSetDim obj As SWbemObjectSet wmiObjSet = GetObject(winmgmts:impersonationLevel=impe

4、rsonate). _InstancesOf(Win32_PhysicalMemory)On Local Error Resume NextFor Each objItem In wmiObjSetDebug.Print BankLabel: & objItem.BankLabelDebug.Print Capacity: & objItem.CapacityDebug.Print Caption: & objItem.CaptionDebug.Print CreationClassName: & objItem.CreationClassNameDebug.Print DataWidth:

5、& objItem.DataWidthDebug.Print Description: & objItem.DescriptionDebug.Print DeviceLocator: & objItem.DeviceLocatorDebug.Print FormFactor: & objItem.FormFactorDebug.Print HotSwappable: & objItem.HotSwappableDebug.Print InstallDate: & objItem.InstallDateDebug.Print InterleaveDataDepth: & objItem.Inte

6、rleaveDataDepthDebug.Print InterleavePosition: & objItem.InterleavePositionDebug.Print Manufacturer: & objItem.ManufacturerDebug.Print MemoryType: & objItem.MemoryTypeDebug.Print Model: & objItem.ModelDebug.Print Name: & objItem.nameDebug.Print OtherIdentifyingInfo: & objItem.OtherIdentifyingInfoDeb

7、ug.Print PartNumber: & objItem.PartNumberDebug.Print PositionInRow: & objItem.PositionInRowDebug.Print PoweredOn: & objItem.PoweredOnDebug.Print Removable: & objItem.RemovableDebug.Print Replaceable: & objItem.ReplaceableDebug.Print SerialNumber: & objItem.SerialNumberDebug.Print SKU: & objItem.SKUD

8、ebug.Print Speed: & objItem.SpeedDebug.Print Status: & objItem.StatusDebug.Print Tag: & objItem.TagDebug.Print TotalWidth: & objItem.TotalWidthDebug.Print TypeDetail: & objItem.TypeDetailDebug.Print Version: & objItem.VersionNextEnd Sub操作系统信息Private Sub Command1_Click()Dim wmiObjSet As SWbemObjectSe

9、tDim obj As SWbemObjectDim msg As StringDim dtb As StringDim d As StringDim t As StringDim bias As LongOn Local Error Resume NextSet wmiObjSet = GetObject(winmgmts:impersonationLevel=impersonate).InstancesOf(Win32_OperatingSystem)For Each obj In wmiObjSetMsgBox 你当前使用的系统是 & obj.CaptionNextEnd Sub说明:大

10、家可能会发现一个规律,实际上WMI对信息的提取都是使用了WIN32_类库名这样的规律,下列表格就是微软的操作系统各种硬件类的描述其它WMI管理的类的信息在可以找到,其中也还有部分示例代码简单Win_32类表Win32 ClassesMicrosoft? Windows? classes give you the means to manipulate a variety of objects. The following table identifies the categories of Windows classes.Category Description Computer system

11、 hardware Classes that represent hardware related objects. Operating system Classes that represent operating system related objects. Installed applications Classes that represent software related objects. WMI service management Classes used to manage WMI. Performance counters Classes that represent

12、formatted and raw performance data.硬件类Computer System Hardware Classeshe Cooling Devices subcategory groups classes that represent instrumentable fans, temperature probes, and refrigeration devices.Class Description Win32_Fan Represents the properties of a fan device in the computer system. Win32_He

13、atPipe Represents the properties of a heat pipe cooling device. Win32_Refrigeration Represents the properties of a refrigeration device. Win32_TemperatureProbe Represents the properties of a temperature sensor (electronic thermometer).Input Device ClassesThe Input Devices subcategory groups classes

14、that represent keyboards and pointing devices.Class Description Win32_Keyboard Represents a keyboard installed on a Windows system. Win32_PointingDevice Represents an input device used to point to and select regions on the display of a Windows computer system.Mass Storage ClassesClasses in the Mass

15、Storage subcategory represent storage devices such as hard disk drives, CD-ROM drives, and tape drives.Class Description Win32_AutochkSetting Represents the settings for the autocheck operation of a disk. Win32_CDROMDrive Represents a CD-ROM drive on a Windows computer system. Win32_DiskDrive Repres

16、ents a physical disk drive as seen by a computer running the Windows operating system. Win32_FloppyDrive Manages the capabilities of a floppy disk drive. Win32_PhysicalMedia Represents any type of documentation or storage medium. Win32_TapeDrive Represents a tape drive on a Windows computer.Motherbo

17、ard, Controller, and Port ClassesThe Motherboard, Controllers, and Ports subcategory groups classes that represent system devices. Examples include system memory, cache memory, and controllers.Class Description Win32_1394Controller Represents the capabilities and management of a 1394 controller. Win

18、32_1394ControllerDevice Relates the high-speed serial bus (IEEE 1394 Firewire) Controller and the CIM_LogicalDevice instance connected to it. Win32_AllocatedResource Relates a logical device to a system resource. Win32_AssociatedProcessorMemory Relates a processor and its cache memory. Win32_BaseBoa

19、rd Represents a baseboard (also known as a motherboard or system board). Win32_BIOS Represents the attributes of the computer systems basic input/output services (BIOS) that are installed on the computer. Win32_Bus Represents a physical bus as seen by a Windows operating system. Win32_CacheMemory Re

20、presents cache memory (internal and external) on a computer system. Win32_ControllerHasHub Represents the hubs downstream from the universal serial bus (USB) controller. Win32_DeviceBus Relates a system bus and a logical device using the bus. Win32_DeviceMemoryAddress Represents a device memory addr

21、ess on a Windows system. Win32_DeviceSettings Relates a logical device and a setting that can be applied to it. Win32_DMAChannel Represents a direct memory access (DMA) channel on a Windows computer system. Win32_FloppyController Represents the capabilities and management capacity of a floppy disk d

22、rive controller. Win32_IDEController Represents the capabilities of an Integrated Drive Electronics (IDE) controller device. Win32_IDEControllerDevice Association class that relates an IDE controller and the logical device. Win32_InfraredDevice Represents the capabilities and management of an infrar

23、ed device. Win32_IRQResource Represents an interrupt request line (IRQ) number on a Windows computer system. Win32_MemoryArray Represents the properties of the computer system memory array and mapped addresses. Win32_MemoryArrayLocation Relates a logical memory array and the physical memory array up

24、on which it exists. Win32_MemoryDevice Represents the properties of a computer systems memory device along with its associated mapped addresses. Win32_MemoryDeviceArray Relates a memory device and the memory array in which it resides. Win32_MemoryDeviceLocation Association class that relates a memor

25、y device and the physical memory on which it exists. Win32_MotherboardDevice Represents a device that contains the central components of the Windows computer system. Win32_OnBoardDevice Represents common adapter devices built into the motherboard (system board). Win32_ParallelPort Represents the pro

26、perties of a parallel port on a Windows computer system. Win32_PCMCIAController Manages the capabilities of a Personal Computer Memory Card Interface Adapter (PCMCIA) controller device. Win32_PhysicalMemory Represents a physical memory device located on a computer as available to the operating syste

27、m. Win32_PhysicalMemoryArray Represents details about the computer systems physical memory. Win32_PhysicalMemoryLocation Relates an array of physical memory and its physical memory. Win32_PNPAllocatedResource Represents an association between logical devices and system resources. Win32_PNPDevice Rel

28、ates a device (known to Configuration Manager as a PNPEntity), and the function it performs. Win32_PNPEntity Represents the properties of a Plug and Play device. Win32_PortConnector Represents physical connection ports, such as DB-25 pin male, Centronics, and PS/2. Win32_PortResource Represents an I

29、/O port on a Windows computer system. Win32_Processor Represents a device capable of interpreting a sequence of machine instructions on a Windows computer system. Win32_SCSIController Represents a small computer system interface (SCSI) controller on a Windows system. Win32_SCSIControllerDevice Relat

30、es a SCSI controller and the logical device (disk drive) connected to it. Win32_SerialPort Represents a serial port on a Windows system. Win32_SerialPortConfiguration Represents the settings for data transmission on a Windows serial port. Win32_SerialPortSetting Relates a serial port and its configu

31、ration settings. Win32_SMBIOSMemory Represents the capabilities and management of memory-related logical devices. Win32_SoundDevice Represents the properties of a sound device on a Windows computer system. Win32_SystemBIOS Relates a computer system (including data such as startup properties, time zones, boot configurations, or administrative passwords) and a system BIOS (services, languages, system management properties).

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1