xymc 发表于 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

Else

$strIPAddresses = ""

EndIf

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

Next

以上代码是获取内网IP的
如何排除虚拟网卡VMware Network Adapter VMnet1和VMware Network Adapter VMnet8
只输出物理网卡的IP?
页: [1]
查看完整版本: 如何排除虚拟网卡