利用MAC读取网卡ID?
本帖最后由 jericho0711 于 2012-9-6 23:08 编辑已搜尋到方式,雙网卡的第一個网卡MAC可以正常讀取,但是第二個MAC好像無法讀取网卡ID,不知道有沒有高手可以幫忙一下小弟,使2個MAC都可以正常讀取网卡ID。$MAC = "00:1F:D0:00:00:CB"
_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
EndFunchttp://bild5.de/148782817.jpg 因为一次只能读取一个嘛,你代码中只出现了一个mac啊。把两个分别代入。 回复 2# haijie1223
可以幫忙小弟稍微寫一下如何把2個MAC分別代入嗎,對WMI真的很不熟,不知如何將2個MAC分別代入...
页:
[1]