#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Timers.au3>
Opt("GUIOnEventMode", 1)
$Form1_1 = GUICreate("超越网管计费系统 _by SpriteCN", 550, 398, 195, 175, BitOR($WS_MINIMIZEBOX,$WS_SYSMENU,$WS_GROUP), 0)
GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
GUISetBkColor(0x00E0FFFF)
$ButtonStar = GUICtrlCreateButton("开机", 465, 80, 75, 25)
$ButtonDown = GUICtrlCreateButton("关机", 465, 200, 75, 25)
$ButtonReboot = GUICtrlCreateButton("重启", 465, 240, 75, 25)
$ButtonAdd = GUICtrlCreateButton("续费", 465, 120, 75, 25)
$ButtonEnd = GUICtrlCreateButton("结帐", 465, 160, 75, 25)
$ButtonSenmsg = GUICtrlCreateButton("发送消息", 465, 280, 75, 25)
$Label1 = GUICtrlCreateLabel("www.zixue8.net", 425, 350)
$ButtonTotal = GUICtrlCreateButton("营业统计", 465, 320, 75, 25)
Global $listView1=GUICtrlCreateListView(" 机器编号 | 机器状态 | 预交金额 | 开始时间 | 结束时间 ",5,10,455,340)
Global $client=IniReadSection("config.ini","client")
Global $item[$client[0][0]]
AdlibRegister("_refresh",2000)
For $i=1 To $client[0][0]
$item[$i-1]=GUICtrlCreateListViewItem($client[$i][0],$listView1)
Next
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(20)
WEnd
Func _refresh()
For $i=1 To $client[0][0]
$var=Ping($client[$i][1],200)
If $var Then
GUICtrlSetData($item[$i-1],"|在线|||")
Else
GUICtrlSetData($item[$i-1],"|离线|||")
EndIf
Next
EndFunc
Func SpecialEvents()
AdlibUnRegister("_refresh")
Exit
EndFunc