|
发表于 2023-9-21 09:16:05
|
显示全部楼层
只有个硬件信息查看代码
#include
$g_szversion = "info"
if winexists($g_szversion) then exit
autoitwinsettitle($g_szversion)
opt('guicloseonesc', 0)
guicreate("硬件信息查看器", 500, 350)
guictrlcreatelabel("bios:", 10, 30, 60, 30)
guictrlsetcolor(-1, 0x0000ff)
$bios = guictrlcreateinput("", 80, 20, 250, 25)
guictrlcreatelabel("主板:", 10, 70, 60, 30)
guictrlsetcolor(-1, 0x0000ff)
$board = guictrlcreateinput("", 80, 60, 250, 25)
guictrlcreatelabel("cpu:", 10, 110, 60, 30)
guictrlsetcolor(-1, 0x0000ff)
$cpu = guictrlcreateinput("", 80, 100, 250, 25)
guictrlcreatelabel("显卡:", 10, 150, 60, 30)
guictrlsetcolor(-1, 0x0000ff)
$display = guictrlcreateinput("", 80, 140, 250, 25)
guictrlcreatelabel("声卡:", 10, 190, 60, 30)
guictrlsetcolor(-1, 0x0000ff)
$sound = guictrlcreateinput("", 80, 180, 250, 25)
guictrlcreatelabel("网卡:", 10, 230, 60, 30)
guictrlsetcolor(-1, 0x0000ff)
$network = guictrlcreateinput("", 80, 220, 250, 25)
guictrlcreatelabel("内存:", 10, 270, 60, 30)
guictrlsetcolor(-1, 0x0000ff)
$mem = guictrlcreateinput("", 80, 260, 250, 25)
guictrlcreatelabel("操作系统:", 10, 310, 60, 30)
guictrlsetcolor(-1, 0x0000ff)
$os = guictrlcreateinput("", 80, 300, 250, 25)
guisetstate()
info()
while 1
$msg = guigetmsg()
select
case $msg = $gui_event_close
exitloop
endselect
wend
func info()
$objwmiservice = objget("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
$colbios = $objwmiservice.execquery("select * from win32_bios")
$colboard = $objwmiservice.execquery("select * from win32_baseboard")
$colsettings = $objwmiservice.execquery("select * from win32_operatingsystem")
$colmemory = $objwmiservice.execquery("select * from win32_computersystem")
$colcpu = $objwmiservice.execquery("select * from cim_processor")
$colvideoinfo = $objwmiservice.execquery("select * from win32_videocontroller")
$colsound = $objwmiservice.execquery("select * from win32_sounddevice")
$colmouse = $objwmiservice.execquery("select * from win32_pointingdevice")
$colmonitor = $objwmiservice.execquery("select * from win32_desktopmonitor")
$colnic = $objwmiservice.execquery("select * from win32_networkadapter where netconnectionstatus = 2")
for $object in $colbios
guictrlsetdata($bios, stringmid($object.caption, 1))
next
for $object in $colboard
guictrlsetdata($board, $object.product)
next
for $object in $colcpu
guictrlsetdata($cpu, stringstripws($object.name, 1))
next
for $object in $colvideoinfo
guictrlsetdata($display, stringstripws($object.description, 1))
next
for $object in $colsound
guictrlsetdata($sound, stringstripws($object.description, 1))
next
for $object in $colnic
guictrlsetdata($network, stringstripws($object.name, 1))
next
for $objoperatingsystem in $colsettings
guictrlsetdata($os, $objoperatingsystem.caption & " build " & $objoperatingsystem.buildnumber & " sp " & $objoperatingsystem.servicepackmajorversion & "." & $objoperatingsystem.servicepackminorversion)
next
for $object in $colmemory
guictrlsetdata($mem, string(int(number($object.totalphysicalmemory) / (1024 * 1024))) & " mb")
next
endfunc ;==>info
|
|