找回密码
 加入
搜索
查看: 2099|回复: 0

[网络通信] 如何排除虚拟网卡

  [复制链接]
发表于 2017-6-28 22:26:29 | 显示全部楼层 |阅读模式
Dim $strIPAddresses = "", $config

Dim $WMI = ObjGet("winmgmts:")

Dim $colNic = $WMI.ExecQuery("SELECT * FROM " & "Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")

For $config In $colNic

ConsoleWrite("Network Adapter: " & $config.Index)

If IsArray($config.IPAddress) Then

  $strIPAddresses = $config.IPAddress[0]

Else

  $strIPAddresses = ""

EndIf

ConsoleWrite("  IP Address(es): " & $strIPAddresses & @CRLF)

Next

以上代码是获取内网IP的
如何排除虚拟网卡VMware Network Adapter VMnet1和VMware Network Adapter VMnet8
只输出物理网卡的IP?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-12-22 21:36 , Processed in 0.076381 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表