回复 11# lhy6456210
在网上找到的,加个判断$a = IniRead(@ScriptDir & "\mac.ini", "mac", "1", "")
If _GetMAC(@IPAddress1) == $a Then
MsgBox(0, 0, "相对")
Else
MsgBox(0, 0, "不相对")
EndIf
Func _GetMAC($sIP)
Local $MAC, $MACSize
Local $i, $s, $r, $iIP
$MAC = DllStructCreate("byte[6]")
$MACSize = DllStructCreate("int")
DllStructSetData($MACSize, 1, 6)
$r = DllCall("Ws2_32.dll", "int", "inet_addr", "str", $sIP)
$iIP = $r[0]
$r = DllCall("iphlpapi.dll", "int", "SendARP", "int", $iIP, "int", 0, "ptr", DllStructGetPtr($MAC), "ptr", DllStructGetPtr($MACSize))
$s = ""
For $i = 0 To 5
If $i Then $s = $s & ":"
$s = $s & Hex(DllStructGetData($MAC, 1, $i + 1), 2)
Next
Return $s
EndFunc ;==>_GetMAC
;~ Mac.ini
;~ [mac]
;~ 1=00:00:00:00:00:00
;~ 2=00:00:00:00:00:00
;~ 3=00:00:00:00:00:00
|