网卡
/*
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
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

