清除 Shell.Explorer 的 Cookies (立即生效)

许多实用脚本和封装函数, 可以让您编写脚本更加便捷高效

Moderators: tmplinshi, arcticir

Post Reply
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

清除 Shell.Explorer 的 Cookies (立即生效)

Post by tmplinshi » 03 Oct 2014, 22:31

Code: Select all

Gui, Font, s15 bold
Gui, Add, ActiveX, w800 h400 vWB, Shell.Explorer
	WB.Navigate("http://ahkscript.org/boards")
Gui, Add, Link, cRed gClearCookies, 先登录论坛,然后 <a>清除 Cookies</a> 试试
Gui, Show
GuiControl, Focus, wb
Return

ClearCookies:
	ClearWebHistory("Cookies")
	DllCall("wininet\InternetSetOption", "int", 0, "int", INTERNET_OPTION_END_BROWSER_SESSION := 42, "int", 0, "int", 0)

	WB.Navigate("http://ahkscript.org/boards")
Return

GuiClose:
ExitApp

ClearWebHistory(sCmd) {
	; by ahklerner
	ValidCmdList 	= Files,Cookies,History,Forms,Passwords,All,All2

	Files 			= 8 	; Clear Temporary Internet Files
	Cookies 		= 2 	; Clear Cookies
	History 		= 1 	; Clear History
	Forms 			= 16 	; Clear Form Data
	Passwords 		= 32 	; Clear Passwords
	All 			= 255 	; Clear all
	All2 			= 4351 	; Clear All and Also delete files and settings stored by add-ons

	If sCmd in %ValidCmdList%
	{
		iCmd = % %sCmd% ; Get the integer value
		; thanks sean :)
		; http://www.autohotkey.com/forum/viewtopic.php?p=211775#211775
		VarSetCapacity(wCmd,15,0)
		DllCall("MultiByteToWideChar", "Uint", 0, "Uint", 0, "str", iCmd, "int", -1, "str", wCmd, "int", 8)
		DllCall("inetcpl.cpl\ClearMyTracksByProcessW", "Uint", 0, "Uint", 0, "str", wCmd, "int", 0)
	}
	Else
		MsgBox Invalid Command -%sCmd%-`nValid commands are`n%ValidCmdList%

	return ErrorLevel
}
Post Reply

Return to “脚本函数”