你别人有没有更好的方法;
楼下的加油.__wmi_Win32_NetworkAdapter()
Func __wmi_Win32_NetworkAdapter()
Local $wbemFlagReturnImmediately = 0x10
Local $wbemFlagForwardOnly = 0x20
Local $colItems = ""
Local $strComputer = "localhost"
Local $objWMIService = ObjGet("winmgmts:\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) then
For $objItem In $colItems
;第一种方法
;If $objItem.netconnectionID = "本地连接" Then MsgBox(0,0, "板载网卡的MAC是:" & $objItem.MACAddress )
;第二种方法 关键词可以在设备管理器中查看.
If StringInStr ($objItem.Name, "realtek") Then MsgBox(0,0, "板载网卡的MAC是:" & $objItem.MACAddress )
Next
Else
Msgbox(0,"WMI 输出","没有在类 " & "Win32_NetworkAdapter" & "中找到WMI对象" )
Endif
EndFunc
|