[已解决]如何利用MAC或者网卡的连接名称来返回网卡Interfaces名,不要枚举interfaces
本帖最后由 daiyu116 于 2011-6-10 10:15 编辑现在遇到了问题,想知道如何利用MAC地址或者网卡的连接名称返回网卡Interfaces名
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces
对wmi不是太懂,但希望是利用wmi来完成~
求各前辈指教! 是要这样吗?论坛很多这样的 信息吧
$MAC = "45:87:FC:8C:86:68"
_wmi_SettingID($MAC)
Func _wmi_SettingID($MAC1)
Local $wbemFlagReturnImmediately = 0x10
Local $wbemFlagForwardOnly = 0x20
Local $colItems = ""
Local $strComputer = "localhost"
Local $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled != 0", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly);固定IP\IP地址\MAC地址
For $objItem In $colItems
If $objItem.MACAddress = $MAC1 Then
MsgBox(4096,"SettingID","SettingID: " & $objItem.SettingID )
EndIf
Next
EndFunc
回复 2# 502762378
是嘛?不过我怎么没搜到呢,看来还是知识尚浅
不管怎样 502762378 谢谢了哈,这个函数好用,非常感谢~ {:face (288):},我需要获得网卡硬件ID 就是那个PCI什么的
页:
[1]