Pingergebnis ausgeben

  • So ?

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GuiIPAddress.au3>
    #include <WindowsConstants.au3>
    #include <Inet.au3>
    #include <EditConstants.au3>
    #include <StaticConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global $IPAdress1

    [/autoit] [autoit][/autoit] [autoit]

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Ping", 400, 270, 400, 200)
    $IPAddress1 = _GUICtrlIpAddress_Create($Form1, 10, 40, 377, 35)
    GUICtrlCreateGroup("IP Adresse", 7, 25, 385, 54)
    _GUICtrlIpAddress_Set($IPAddress1, "127.0.0.1")
    $Button1 = GUICtrlCreateButton("Ping Starten", 150, 100, 100, 30, 0)
    GUICtrlSetFont(-1, 12, 200, 0, "MS Sans Serif")
    $Edit = GUICtrlCreateEdit("", 10, 150, 380, 100, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_READONLY))
    GUICtrlCreateGroup("", 5, 140, 390, 115)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    case $Button1

    pingen()

    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func pingen()
    Local $name, $ms
    $ms = ping(_GUICtrlIpAddress_Get($IPAddress1))
    TCPStartup()
    $name = _TCPIpToName(_GUICtrlIpAddress_Get($IPAddress1), 0)
    TCPShutdown()
    If $name = "" Then $name = _GUICtrlIpAddress_Get($IPAddress1)
    GUICtrlSetData($Edit, GUICtrlRead($Edit) & "In " & $ms & " ms wurde '" & $name & "' erreicht." & @CRLF)
    EndFunc

    [/autoit]

    Zur Nutzung dieses Forum's, ist ein Übersetzer für folgende Begriffe unerlässlich:

    "On-Bort, weier, verscheiden, schädliges, Butten steyling, näckstet, Parr, Porblem, scripe, Kompletenz, harken, manuel zu extramieren, geckukt, würglich, excell, acces oder Compilevorgeng"