修改了少少
#include <WinINet.au3>
#include <IE.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3> ;图形界面用的
;#include <Constants.au3>
Opt("GUIOnEventMode", 1)
Opt("TrayMenuMode", 1) ;关闭托盘菜单
Opt("TrayOnEventMode", 1) ;启用托盘 OnEvent 事件函数通知 这2个一起用才能彻底屏蔽托盘菜单
Dim $oIE, $S = True,$shu
$Form1 = GUICreate("网站", 800, 500, 192, 124)
$oIE = _IECreateEmbedded()
GUICtrlCreateObj($oIE, -200, -130, 840, 750)
$Label4 = GUICtrlCreateLabel("访问次数:", 648, 128, 64, 30)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "_Mwin")
$Button1 = GUICtrlCreateButton("开始", 648, 180, 150, 25)
GUICtrlSetOnEvent(-1,"button")
GUISetState(@SW_SHOW)
HotKeySet("{F6}", "_Exit")
While 1
DelCache(0)
If $S = False Then Exit
_IENavigate($oIE, "http://www.qq.com/")
$shu = $shu + 1
GUICtrlSetData($Label4, "访问次数:" & $shu & "次")
If @HOUR = 0 Then $tmp = Random(40, 60, 1)
If @HOUR = 1 Then $tmp = Random(50, 60, 1)
If @HOUR = 2 Then $tmp = Random(50, 60, 1)
If @HOUR = 3 Then $tmp = Random(50, 60, 1)
If @HOUR = 4 Then $tmp = Random(50, 60, 1)
If @HOUR = 5 Then $tmp = Random(50, 60, 1)
If @HOUR = 6 Then $tmp = Random(50, 60, 1)
If @HOUR = 7 Then $tmp = Random(50, 60, 1)
If @HOUR = 8 Then $tmp = Random(50, 60, 1)
If @HOUR = 9 Then $tmp = Random(30, 50, 1)
If @HOUR = 10 Then $tmp = Random(30, 40, 1)
If @HOUR = 11 Then $tmp = Random(10, 30, 1)
If @HOUR = 12 Then $tmp = Random(10, 30, 1)
If @HOUR = 13 Then $tmp = Random(10, 20, 1)
If @HOUR = 14 Then $tmp = Random(10, 20, 1)
If @HOUR = 15 Then $tmp = Random(5, 20, 1)
If @HOUR = 16 Then $tmp = Random(5, 20, 1)
If @HOUR = 17 Then $tmp = Random(5, 10, 1)
If @HOUR = 18 Then $tmp = Random(5, 10, 1)
If @HOUR = 19 Then $tmp = Random(5, 10, 1)
If @HOUR = 20 Then $tmp = Random(3, 8, 1)
If @HOUR = 21 Then $tmp = Random(3, 8, 1)
If @HOUR = 22 Then $tmp = Random(3, 8, 1)
If @HOUR = 23 Then $tmp = Random(5, 10, 1)
If @HOUR = 24 Then $tmp = Random(10, 20, 1)
$tmp = $tmp * 1000
Sleep($tmp)
WEnd
Func Button()
GUICtrlSetData($Button1, "快捷键:F6结束")
$shu = 0
EndFunc
Func _Exit()
$S = False
EndFunc ;==>_Exit
Func _Mwin()
GUISetState(@SW_HIDE, $Form1)
Opt("TrayIconHide", 0)
EndFunc ;==>_Mwin
;点托盘恢复窗口
Func _huifu()
;Opt("TrayIconHide", 1) ;隐藏托盘
GUISetState(@SW_SHOW, $Form1)
WinActivate($Form1)
EndFunc ;==>_huifu
Func DelCache($iCacheEntryType)
_WinINet_Startup()
While $S ;开关,防卡死
Sleep(1) ;以防cpu占用超高
$avCacheEntry = _WinINet_FindFirstUrlCacheEntry($iCacheEntryType)
If @error Then Return SetError(@error, @extended, 0)
$avHarray = $avCacheEntry[1]
_WinINet_DeleteUrlCacheEntry($avHarray[1])
WEnd
_WinINet_FindCloseUrlCache($avCacheEntry[0])
_WinINet_Shutdown()
EndFunc ;==>DelCache
|