Spoiler anzeigen
#NoTrayIcon
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=C:\Users\Firstshoot\Desktop\ping.kxf
$Form1 = GUICreate("Form1", 291, 151, 192, 124)
GUISetCursor(2)
GUISetBkColor(0x000000)
$URL = GUICtrlCreateInput("URL", 45, 10, 200, 21)
GUICtrlSetBkColor(-1, 0x800000)
$Start = GUICtrlCreateButton("Start", 45, 50, 200, 50, 0)
GUICtrlSetBkColor(-1, 0x800000)
GUICtrlSetCursor(-1, 2)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Start
$p = Ping(GUICtrlRead($URL))
If Not @error Then
MsgBox(0, "Status", "Server: Online - Time: " & $p)
Else
Switch @error
Case 1
$error = 'Der Computer ist offline'
Case 2
$error = 'Der Computer ist nicht erreichbar'
Case 3
$error = 'Falsche Adresse'
Case 4
$error = 'Andere Fehler'
EndSwitch
MsgBox(0, "Status", $error)
EndIf
EndSwitch
WEnd