能力有限。花半个小时写的。根据自己需要改改吧。#NoTrayIcon
If $CmdLine[0] <> 0 Then
$p = Ping($CmdLine[1], 250)
IniWrite("ping.ini", "IP=ping", $CmdLine[1], $p)
exit
endif
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("AU3局域网群Ping", 510, 420)
dim $Button[256]
$h = 30
$s = 20
for $i = 1 to 255
$Button[$i] = GUICtrlCreateButton($i, $h, $s, 30, 20)
;GUICtrlSetState(-1,$GUI_DISABLE)
$h = $h + 30
if $h > 450 then
$h = 30
$s = $s + 20
endif
next
$Buttona1 = GUICtrlCreateButton("开始", 136, 380, 75, 25)
$Buttona2 = GUICtrlCreateButton("退出", 312, 380, 75, 25)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $Buttona1
if @Compiled = 1 then
p()
else
msgbox(48,"错误","请编译后再执行此操作!",30,$Form1)
endif
case $Buttona2
Exit
EndSwitch
WEnd
func p()
dim $r[256]
For $i = 1 to 255
$r[$i] = run(@ScriptFullPath&" 192.168.1."&$i)
next
For $i = 1 to 255
ProcessWaitClose($r[$i])
next
For $i = 1 to 255
if IniRead("ping.ini", "IP=ping", "192.168.1."&$i, "") > 0 then GUICtrlSetBkColor($Button[$i], 0x00ff00)
next
endfunc
|