Hey leute
ich habe einen Scirpt gefunden womit ich die MAC Adresse einer Netzwerkkarte anzeigen lassen kann...
Leider funktioniert das ganze nicht so wie ich mir das vorgestellt habe...
Oder ich habe es einfach nur falsche gemacht das kann natürlich auch sein.
Kann mir jemand von euch sagen wo mein fehler ist oder ob man die MAC Adresse auch noch einfacher auslesen kann?
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Inet.au3>
Func _GetMacAddress($_phisycaladdress)
Local $chk_1 = StringReplace($_phisycaladdress, '.', '') / 1
If @extended <> 3 Or $chk_1 < 1 Then Return ''
Local $chk_2 = StringSplit($_phisycaladdress, '.', 1)
For $idx_chk = 1 To $chk_2[0]
If ($chk_2[$idx_chk] / 1) < 0 or ($chk_2[$idx_chk] / 1) > 255 Then Return ''
Next
Local $_buf = ''
Local $_pid = Run('nbtstat -a ' & $_phisycaladdress, '', @SW_HIDE, 2)
Do
$_buf &= StdoutRead($_pid)
Until @error
If StringReplace($_buf, 'MAC Adresse = ', '') <> $_buf Then
$chk_3 = StringSplit($_buf, 'MAC Adresse = ', 1)
Return StringReplace(StringReplace($chk_3[2], @CR, ''), @LF, '')
EndIf
Return ''
EndFunc
$ipadresse=@IPAddress1
$mac=_GetMacAddress($ipadresse)
$Form1_1 = GUICreate("IPS V1.2", 181, 166, 216, 157)
$Label1 = GUICtrlCreateLabel("Ihre IP Adresse", 8, 8, 76, 17)
$Label2 = GUICtrlCreateLabel(""&_GetIP(), 8, 32, 155, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x4A9309)
$Label3 = GUICtrlCreateLabel("Uhrzeit", 8, 122, 37, 17)
$time = GUICtrlCreateLabel("", 8, 142, 58, 17)
GUICtrlSetColor(-1, 0x4A9309)
$Label4 = GUICtrlCreateLabel("Ihre MAC Adresse", 8, 56, 89, 17)
$mac = GUICtrlCreateLabel("LADE", 8, 80, 51, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x4A9309)
GUISetState(@SW_SHOW)
msgbox(0,"Ausgabe der MAC Adresse",$mac)
[/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]$start=timerinit()
While 1
if timerdiff($start)>=1000 then
$start=timerinit()
GUICtrlSetData($time,@HOUR &":"&@MIN &":"& @sec)
EndIf
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd