网卡
/* AHK V2 读取当前电脑的网卡信息 */ SwbemServices:= ComObjGet("Winmgmts:") Nets := SwbemServices.ExecQuery("Select * from Win32_NetworkAdapter WHERE PhysicalAdapter ='TRUE'") MsgBox Nets.Count if(Nets.Count<0) Nets:=SwbemServices.ExecQuery("Select * from Win32_NetworkAdapter WHERE PNPDeviceID Like 'PCI%%' or PNPDeviceID Like 'USB%%'") For Net In Nets { If Net.NetConnectionStatus > 0 str.= "网卡名称: " Net.Name "`n" } For Net In Nets { If(Net.NetEnabled <>0) str1.= "网卡名称: " Net.Name "`n" else str2.="网卡名称: " Net.Name "`n" } MsgBox "网卡共有如下:`n" str MsgBox "当前正在使用:`n" str1 MsgBox "空闲:`n" str2
学习一下