4月102018
AU3内嵌IE版本控制
#RequireAdmin
#PRE_UseX64=n
#QQ群:477266297
#AU3论坛:www.autoit3.cn
#include <array.au3>
#include <Winapi.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#AutoIt3Wrapper_Res_Language=2052
#AutoIt3Wrapper_Res_LegalCopyright=Copyright ? 2013-2015
#AutoIt3Wrapper_UseUpx=y
#AutoIt3Wrapper_Res_Fileversion=1.0
#AutoIt3Wrapper_OutFile=获取cookies.exe
#AutoIt3Wrapper_Icon=D:\autoit3\Aut2Exe\Icons\AutoIt_Main_v10_48x48_RGB-A.ico
#NoTrayIcon
#RequireAdmin#AutoIt3Wrapper_UseX64=n
#include <Timers.au3>
#include <WinAPI.au3>
#include <IE.au3>
#include <FTPEx.au3>
Opt('MouseCoordMode', 0)
Opt('MustDeclareVars', 1)
_AddMyIEVersion(1)
;~ Global Const $WM_PASTE = 0x0302
Global Const $INTERNET_COOKIE_HTTPONLY = 8192
Global Const $INTERNET_COOKIE_THIRD_PARTY = 131072
Global Const $INTERNET_FLAG_RESTRICTED_ZONE = 16
Global $hMainForm, $obj, $Btn_GetCookies, $Btn_Flash, $Btn_LoginUrl
Global $tag = 1
Global $sLoginUrl = 'http://www.ip138.com/useragent/'
;~ Global $sLoginUrl = 'http://www.baidu.com/'
$hMainForm = GUICreate('查看浏览器内核版本', 660, 600)
$obj = ObjCreate("Shell.Explorer.2")
GUICtrlCreateObj($obj, -2, -2, 660, 500)
$obj.navigate($sLoginUrl)
Global $EventObject2 = ObjEvent($obj, "IEEvent_", "DWebBrowserEvents2") ;注册获取 IE对象产生的事件,有事件则调用后面的相关函数
$Btn_Flash = GUICtrlCreateButton('刷新', 10, 550, 100, 20)
$Btn_LoginUrl = GUICtrlCreateButton('登录界面', 150, 550, 100, 20)
$Btn_GetCookies = GUICtrlCreateButton('获取cookies', 300, 550, 100, 20)
GUISetState()
;~ Global $iTimer = _Timer_SetTimer($hMainForm, 600000, "FlushWeb") ; 创建计时器
While 1
Switch GUIGetMsg()
Case -3
Exit _AddMyIEVersion(1)
Case $Btn_LoginUrl
Case $Btn_GetCookies
Case $Btn_Flash
EndSwitch
WEnd
Func _AddMyIEVersion($tag = 1)
Local $script = @ScriptName
If Not @Compiled Then
If $tag = 1 Then
RegWrite('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3.exe', 'REG_DWORD', '9000')
RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3.exe', 'REG_DWORD', '9000')
RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3.exe', 'REG_DWORD', '9000')
RegWrite('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3_x64.exe', 'REG_DWORD', '9000')
RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3_x64.exe', 'REG_DWORD', '9000')
RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3_x64.exe', 'REG_DWORD', '9000')
Else
RegDelete('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3.exe')
RegDelete('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3.exe')
RegDelete('HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3.exe')
RegDelete('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3_x64.exe')
RegDelete('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3_x64.exe')
RegDelete('HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', 'AutoIt3_x64.exe')
EndIf
Else
If $tag = 1 Then
RegWrite('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', $script, 'REG_DWORD', '11000')
RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', $script, 'REG_DWORD', '11000')
RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', $script, 'REG_DWORD', '11000')
Else
RegDelete('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', $script)
RegDelete('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', $script)
RegDelete('HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', $script)
EndIf
EndIf
EndFunc ;==>_AddMyIEVersion
扫描二维码,在手机上阅读
发表评论
木有头像就木JJ啦!还木有头像吗?点这里申请属于你的个性Gravatar头像吧!