hallo liebe community
als sys-admin, brauche ich ab und zu einen ip scanner, der mir mitteilt welche ip's erreichbar sind.
ich hab da mal was programmiert, habe allerdings keine ahnung, wie ich den ping-prozess abbrechen soll.
kann mir jemand dabei helfen?
Spoiler anzeigen
#include <iNet.au3>
#include <GuiIPAddress.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <GuiStatusBar.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ListViewConstants.au3>
#Include <GuiListView.au3>
#cs ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]AutoIt Version: 3.3.6.0
Author: Gianni
Script Function:
Pingt IP's im LAN
#ce ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]; Script Start - Add your code below here
[/autoit] [autoit][/autoit] [autoit]#Region ### START Koda GUI section ### Form=d:\programmierung\autoit\pingmylan\form\form.kxf
$form = GUICreate("pingMyLAN", 267, 273, 192, 124)
$inpIP = _GUICtrlIpAddress_Create($form, 96, 16, 100, 21)
_GUICtrlIpAddress_Set($inpIP, "192.168.0.1")
$labelIP = GUICtrlCreateLabel("IP-Adresse:", 16, 16, 75, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Arial")
$labelBis = GUICtrlCreateLabel("-", 202, 8, 12, 33)
GUICtrlSetFont(-1, 18, 800, 0, "Arial")
$inpBis = GUICtrlCreateInput("255", 216, 16, 33, 21)
$statusBar = _GUICtrlStatusBar_Create($form)
_GUICtrlStatusBar_SetText ($statusBar, "Stop")
$ListView1 = GUICtrlCreateListView("IP | Hostname", 8, 88, 250, 150)
_GUICtrlListView_SetColumnWidth ($ListView1, 0, 100)
_GUICtrlListView_SetColumnWidth ($ListView1, 1, 135)
$btnStart = GUICtrlCreateButton("Start", 120, 48, 59, 25, $WS_GROUP)
$btnStop = GUICtrlCreateButton("Stop", 192, 48, 59, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $btnStart
$pingIP = _GUICtrlIpAddress_Get($inpIP)
$pingBis = GUICtrlRead($inpBis)
_pingIP($pingIP, $pingBis)
EndSwitch
WEnd
Func _pingIP($ip, $ipBis)
$splitIP = StringSplit($ip, ".")
For $i = $splitIP[4] To $ipBis
$ip = String($splitIP[1] & "." & $splitIP[2] & "." & $splitIP[3] & "." & $i)
_GUICtrlStatusBar_SetText ($statusBar, "Ping: " & $ip)
$ping = Ping($ip, 1000)
If $ping > 0 Then
$host = _TCPIpToName($ip)
$item1 = GUICtrlCreateListViewItem($ip & "|" & $host, $ListView1)
EndIf
Next
EndFunc
ps: ich weiss, es wurde schon so etwas programmiert, allerdings möchte ich mein eigenes gebrauchen und noch für weitere interne sachen erweitern.
vielen dank für die hilfe