请问ie临时文件夹的问题!
#Include <File.au3>
#Include <Array.au3>
$_CookiesDir1 = @UserProfileDir & '\AppData\Local\Microsoft\Windows\Temporary Internet Files'
FileDelete(""&$_CookiesDir1)
MsgBox(4096, "", "" &$_CookiesDir1)
但为什么无法实现呢?无法删除文件夹里的内容? http://www.autoitx.com/thread-22759-1-1.html 本帖最后由 mtvtop 于 2011-12-21 19:35 编辑
回复 2# 风行者
这个用了。在ie6上运行报错
我的电脑是 2003 sp1 ie6
运行DelCache(2)和DelCache(0)这个代码会白板卡死DelCache(1)可以通过,能帮忙解决一下吗 cpu耗用100% 程序源代码,麻烦帮忙看看,是什么地方造成的耗用到100%
#include <WinINet.au3>
#include <IE.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3> ;图形界面用的
;#include <Constants.au3>
Dim $oIE
$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)
GUISetState(@SW_SHOW)
Opt("TrayMenuMode",1) ;关闭托盘菜单
Opt("TrayOnEventMode",1) ;启用托盘 OnEvent 事件函数通知 这2个一起用才能彻底屏蔽托盘菜单
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Form1
Case $Button1
GUICtrlSetData($Button1,"快捷键:F6结束")
$shu=0
While 1
DelCache(0)
HotKeySet("{F6}", "_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)
;MsgBox("","", $tmp)
$tmp = $tmp*1000
sleep($tmp)
WEnd
EndSwitch
WEnd
Func _Exit()
Exit
EndFunc
Func _Mwin()
GUISetState(@SW_HIDE, $Form1)
Opt("TrayIconHide", 0)
EndFunc
;点托盘恢复窗口
Func _huifu()
;Opt("TrayIconHide", 1) ;隐藏托盘
GUISetState(@SW_SHOW, $Form1)
WinActivate($Form1)
EndFunc
Func DelCache($iCacheEntryType)
_WinINet_Startup()
While 1
$avCacheEntry = _WinINet_FindFirstUrlCacheEntry($iCacheEntryType)
If @error Then Return SetError(@error,@extended,0)
$avHarray = $avCacheEntry
_WinINet_DeleteUrlCacheEntry($avHarray)
WEnd
_WinINet_FindCloseUrlCache($avCacheEntry)
_WinINet_Shutdown()
EndFunc ;==>DelCookies
回复 2# 风行者
兄弟能不能帮帮忙 修改了少少
#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
_WinINet_DeleteUrlCacheEntry($avHarray)
WEnd
_WinINet_FindCloseUrlCache($avCacheEntry)
_WinINet_Shutdown()
EndFunc ;==>DelCache
回复 7# 风行者
风行兄 代码的cpu耗用降低下来了,但运行还是不出现网站,白色的,是不是不支持2003? xp测试正常,2003没环境测试不好说 回复 9# 风行者
2003 系统有什么其他的方法没有?头疼呀 回复 9# 风行者
我刚才测试了一下,发现在2003下DelCache(0) 没有执行起来
改成DelCache(1)才能运行,但我需要删除所有临时文件,能帮忙找一下问题吗?
页:
[1]