通过WMI获取系统.进程.CPU.磁盘.分区.网卡.主板.内存.显卡.共享.键盘.鼠标等信息 您所在的位置:网站首页 显卡8180 通过WMI获取系统.进程.CPU.磁盘.分区.网卡.主板.内存.显卡.共享.键盘.鼠标等信息

通过WMI获取系统.进程.CPU.磁盘.分区.网卡.主板.内存.显卡.共享.键盘.鼠标等信息

2024-07-12 12:07| 来源: 网络整理| 查看: 265

*!* 作 者:十豆三 *!* 日 期:2011-08-05 *!* 说 明:通过WMI获取系统.进程.CPU.磁盘.分区.网卡.主板.内存.显卡.共享.键盘.鼠标等信息

oWMI=Getobject('winmgmts:')      && vfp9.0 m.cWin32Class='Win32_Processor'  && CPU信息 ( ProcessorId 项为序列号) oItems=oWMI.ExecQuery('Select * From '+m.cWin32Class) Create Cursor GetInfo (_Property C(50),_Value C(200)) For Each oItem In oItems         && 如有多个相同类型设备,也一齐取出。(如取硬盘信息时,有多块硬盘时也会全部取出)     For Each oProperty In oItem.Properties_         lcName=oProperty.Name         lcVal=Transform(oProperty.Value)         Try             Insert Into GetInfo Values (lcName,lcVal)         Catch         Endtry     Endfor Endfor Locate Browse Return

修改 m.cWin32Class='Win32_Process' 的值可获得其他信息 Win32_ComputerSystem                  && 计算机系统信息 Win32_Process                         && 进程信息 Win32_Processor                       && CPU信息 ( ProcessorId 项为序列号) Win32_DiskDrive                       && 磁盘信息 ( PNPDeviceID 项中\之后为序列号) Win32_LogicalDisk                     && 分区(盘符)信息 Win32_NetworkAdapterConfiguration     && 网卡信息 ( IPAddress 项为IP地址, MACAddress 项为MAC地址) Win32_BaseBoard                       && 主板信息 ( Manufacturer 项为主板生产商, Product 项为主板名称) Win32_PhysicalMemory                  && 内存信息 ( Capacity 项为内存容量[字节]) Win32_VideoController                 && 显示卡信息 Win32_Share                           && 共享信息 Win32_Keyboard                        && 键盘信息 Win32_PointingDevice                  && 鼠标和触摸版信息 更多请参考 MSDN

vfp9.0 以下要把 oWMI=Getobject('winmgmts:') 改为 oWS=Createobject("WbemScripting.SWbemLocator") oWMI=oWS.ConnectServer(".","root\cimv2")

 



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有