本帖最后由 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
EndFunc
|