|
发表于 2012-4-3 08:03:22
|
显示全部楼层
额,昨天辛苦做了一个工具,刚好有你的功能,代码:
#include <GUIConstantsEx.au3>
#include <IE.au3>
Opt("GUIOnEventMode", 1)
$mainwindow = GUICreate("IE自动刷新工具", 300, 120)
Global $oIE,$url,$urlbefore,$time
If FileExists(@ScriptDir&"\refresh.ini") Then
$urlbefore = IniRead(@ScriptDir&"\refresh.ini", "section2", "key", "NotFound")
$time = IniRead(@ScriptDir&"\refresh.ini", "section", "key", "NotFound")
Else
$urlbefore = ""
$time = 60
EndIf
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") ;
$file = GUICtrlCreateInput($urlbefore,30,30,200)
$okbutton = GUICtrlCreateButton("确定", 30,90, 60)
GUICtrlCreateLabel("时间间隔(以秒为单位)",30,60)
GUICtrlCreateLabel("请输入网址",30,10)
$file1 = GUICtrlCreateInput($time,150,58,30)
GUICtrlSetOnEvent($okbutton, "OKButton")
GUISetState(@SW_SHOW)
$i = 0
While 1
Select
Case $i = 0
Sleep(10000)
Case $i = 1
Sleep($time)
_IEAction ($oIE, "refresh")
EndSelect
WEnd
Func CLOSEClicked()
Exit
EndFunc
Func OKButton()
$i = 1
$url = GUICtrlRead($file)
$time = GUICtrlRead($file1)
IniWrite(@ScriptDir&"\refresh.ini", "section2", "key", $url)
IniWrite(@ScriptDir&"\refresh.ini", "section", "key", $time)
$oIE = _IECreate (GUICtrlRead($file))
$time = $time*1000
EndFunc |
|