#NoTrayIcon
;~ #include <Process.au3>
#include <Constants.au3> ; 默认菜单项目 (脚本暂停中/退出)(Script Paused/Exit) 将不会显示,并且所选项目不能被选中(checkbox不会打勾) . 请参考TrayMenuMode选项1和2(3=1+2).
Opt("TrayMenuMode", 3)
dim $Serverip
$Serverip = iniread(@ScriptDir & "\intools.ini","配置文件","服务器IP","56.16.26.240")
_Main()
Exit
Func _main()
Local $st_time = IniRead(@ScriptDir & "\intools.ini","配置时间","启动等待时间","60000")
Local $re_time = IniRead(@ScriptDir & "\intools.ini","配置时间","重启时间","20000")
Local $t = ($st_time/1000)
TrayCreateItem("关于")
TrayItemSetOnEvent(-1, "about")
TrayCreateItem("") ; 创建一个分割条.
TrayCreateItem("退出")
TrayItemSetOnEvent(-1, "_exit")
TraySetState(1) ; 显示托盘菜单.
TrayTip("", $t & "秒后检测网络连接",3)
Sleep($st_time)
If Ping($Serverip) Then
TrayTip("","网络已正常连接",2)
Sleep(2000)
Else
TrayTip("","网络连接不正常",2)
Sleep($re_time)
EndIf
EndFunc
Func About()
MsgBox(4096, "", "版本: V 1.0.0.7"& @CRLF & _
"作者: 大蒜")
EndFunc
Func _exit()
Exit
EndFunc
|