AU3真正的 修改IE 代理 即使生效·
```#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
Global $radHome, $radGehl, $guiProxy, $proxyAutoSettings, $IEVersion, $chkBxAutoDetect, $chkBxAutoConfig, $chkBxProxyLan, $inpProxyServer
Global $inpPort, $chkBxBypass, $inpBypassAdd, $inpAutoConfig, $proxyAutoTemp
Global $CONSTKEYPROXY = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
Global $CONSTKEYHOME = "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main"
Global $CONSTKEYAUTO = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections"
Global $CONSTKEYIEVER = "HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer"
Global $AppTitle = "Proxy Changer"
$proxyRegServer = RegRead($CONSTKEYPROXY, "ProxyServer")
$proxyEnable = RegRead($CONSTKEYPROXY, "ProxyEnable")
$proxyOverride = RegRead($CONSTKEYPROXY, "ProxyOverride")
$proxyRegHomePage = RegRead($CONSTKEYHOME, "Start Page")
$proxyGetVersion = RegRead($CONSTKEYIEVER, "Version")
$proxyAutoSettings = RegRead($CONSTKEYAUTO, "DefaultConnectionSettings")
$IEVersion = StringLeft($proxyGetVersion, 1)
$autoConfigUrl = RegRead($CONSTKEYPROXY, "AutoConfigUrl")
If $autoConfigUrl = -1 Then
$autoConfigUrl = ""
EndIf
$proxyAutoTemp = StringMid($proxyAutoSettings, 19, 2)
Switch $proxyAutoTemp
Case "03"
$autoDetect = $GUI_UNCHECKED
$autoConfig = $GUI_UNCHECKED
Case "0B"
$autoDetect = $GUI_CHECKED
$autoConfig = $GUI_UNCHECKED
Case "0F"
$autoDetect = $GUI_CHECKED
$autoConfig = $GUI_CHECKED
Case "07"
$autoDetect = $GUI_UNCHECKED
$autoConfig = $GUI_CHECKED
Case "01"
$autoDetect = $GUI_UNCHECKED
$autoConfig = $GUI_UNCHECKED
Case "09"
$autoDetect = $GUI_CHECKED
$autoConfig = $GUI_UNCHECKED
Case "0D"
$autoDetect = $GUI_CHECKED
$autoConfig = $GUI_CHECKED
Case "05"
$autoDetect = $GUI_UNCHECKED
$autoConfig = $GUI_CHECKED
Case Else
$autoDetect = $GUI_UNCHECKED
$autoConfig = $GUI_UNCHECKED
EndSwitch
#Region ### START Koda GUI section ### Form=c:\my documents\autoit scripts\koda_2008-10-03\forms\form1.kxf
$guiProxy = GUICreate($AppTitle, 499, 507, 231, 168)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Events")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "_Events")
GUISetOnEvent($GUI_EVENT_RESTORE, "_Events")
$grpAuto = GUICtrlCreateGroup("自动配置", 24, 16, 441,115)
$chkBxAutoDetect = GUICtrlCreateCheckbox("自动检测设置", 48, 48, 201, 17)
GUICtrlSetState(-1, $autoDetect)
$chkBxAutoConfig = GUICtrlCreateCheckbox("使用自动配置脚本", 48, 72, 209, 17)
GUICtrlSetState(-1, $autoConfig)
GUICtrlSetOnEvent(-1, "_AutoConfig_Check")
$inpAutoConfig = GUICtrlCreateInput("", 88, 96, 209, 21)
GUICtrlSetData(-1, $autoConfigUrl)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$grpProxy = GUICtrlCreateGroup("代理服务器", 24, 138, 441, 185)
$chkBxProxyLan = GUICtrlCreateCheckbox("使用代理服务器", 64, 160, 193, 17)
GUICtrlSetOnEvent(-1, "_ProxyLan_Check")
$lblProxyAddress = GUICtrlCreateLabel("Address:", 64, 188, 45, 17)
$inpProxyServer = GUICtrlCreateInput("", 124, 184, 137, 21)
$lblPort = GUICtrlCreateLabel("Port:", 298, 188, 26, 17)
$inpPort = GUICtrlCreateInput("", 336, 184, 73, 21)
$chkBxBypass = GUICtrlCreateCheckbox("对于本地地址不使用代理服务器", 64, 222, 241, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$inpBypassAdd = GUICtrlCreateEdit("", 80, 270, 297,42, $ES_MULTILINE)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$btnDefaults = GUICtrlCreateButton("检索系统设置", 70, 424, 150, 33, 0)
GUICtrlSetOnEvent(-1, "_DefaultButton")
$Button2 = GUICtrlCreateButton("使用以上设置", 270, 424, 150, 33, 0)
GUICtrlSetOnEvent(-1, "_AsShown")
If $proxyEnable = 1 Then
$proxyPorttemp = StringSplit($proxyRegServer, ":")
GUICtrlSetState($chkBxProxyLan, $GUI_CHECKED)
GUICtrlSetData($inpProxyServer, $proxyPorttemp[1])
GUICtrlSetData($inpPort, $proxyPorttemp[2])
GUICtrlSetState($chkBxBypass, $GUI_CHECKED)
GUICtrlSetData($inpBypassAdd, $proxyOverride)
GUICtrlSetState($radGehl, $GUI_CHECKED)
Else
GUICtrlSetState($radHome, $GUI_CHECKED)
EndIf
_AutoConfig_Check() ; this will update initial state based on current values
_ProxyLan_Check() ; this will update initial state based on current values
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
Func ProxySetup()
$proxyRegServer = RegRead($CONSTKEYPROXY, "ProxyServer")
$proxyEnable = RegRead($CONSTKEYPROXY, "ProxyEnable")
$proxyOverride = RegRead($CONSTKEYPROXY, "ProxyOverride")
$proxyRegHomePage = RegRead($CONSTKEYHOME, "Start Page")
$proxyGetVersion = RegRead($CONSTKEYIEVER, "Version")
$proxyAutoSettings = RegRead($CONSTKEYAUTO, "DefaultConnectionSettings")
$IEVersion = StringLeft($proxyGetVersion, 1)
$autoConfigUrl = RegRead($CONSTKEYPROXY, "AutoConfigUrl")
If $autoConfigUrl = -1 Then
$autoConfigUrl = ""
EndIf
$proxyAutoTemp = StringMid($proxyAutoSettings, 19, 2)
Switch $proxyAutoTemp
Case "03"
$autoDetect = $GUI_UNCHECKED
$autoConfig = $GUI_UNCHECKED
Case "0B"
$autoDetect = $GUI_CHECKED
$autoConfig = $GUI_UNCHECKED
Case "0F"
$autoDetect = $GUI_CHECKED
$autoConfig = $GUI_CHECKED
Case "07"
$autoDetect = $GUI_UNCHECKED
$autoConfig = $GUI_CHECKED
Case "01"
$autoDetect = $GUI_UNCHECKED
$autoConfig = $GUI_UNCHECKED
Case "09"
$autoDetect = $GUI_CHECKED
$autoConfig = $GUI_UNCHECKED
Case "0D"
$autoDetect = $GUI_CHECKED
$autoConfig = $GUI_CHECKED
Case "05"
$autoDetect = $GUI_UNCHECKED
$autoConfig = $GUI_CHECKED
Case Else
$autoDetect = $GUI_UNCHECKED
$autoConfig = $GUI_UNCHECKED
EndSwitch
If $proxyEnable = 1 Then
$proxyPorttemp = StringSplit($proxyRegServer, ":")
GUICtrlSetState($chkBxProxyLan, $GUI_CHECKED)
GUICtrlSetData($inpProxyServer, $proxyPorttemp[1])
GUICtrlSetData($inpPort, $proxyPorttemp[2])
GUICtrlSetState($chkBxBypass, $GUI_CHECKED)
GUICtrlSetData($inpBypassAdd, $proxyOverride)
GUICtrlSetState($radGehl, $GUI_CHECKED)
Else
GUICtrlSetState($radHome, $GUI_CHECKED)
EndIf
_AutoConfig_Check() ; this will update initial state based on current values
_ProxyLan_Check() ; this will update initial state based on current values
EndFunc
Func _Events()
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE
Exit
Case $GUI_EVENT_MINIMIZE
Case $GUI_EVENT_RESTORE
Case Else
EndSwitch
EndFunc ;==>_Events
Func _DefaultButton()
If $proxyAutoTemp = "03" Or $proxyAutoTemp = "0B" Or $proxyAutoTemp = "0F" Or $proxyAutoTemp = "07" Then
$proxyAutoTemp = "03"
ElseIf $proxyAutoTemp = "01" Or $proxyAutoTemp = "09" Or $proxyAutoTemp = "0D" Or $proxyAutoTemp = "05" Then
$proxyAutoTemp = "01"
EndIf
Select
Case BitAND(GUICtrlRead($radHome), $GUI_CHECKED)
RegWrite($CONSTKEYPROXY, "ProxyEnable", "REG_DWORD", "00000000")
DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0)
Case BitAND(GUICtrlRead($radGehl), $GUI_CHECKED)
$proxyAutoLeft = StringLeft($proxyAutoSettings, 18)
$proxyAutoRight = StringMid($proxyAutoSettings, 21)
$proxyAutoWrite = $proxyAutoLeft & $proxyAutoTemp & $proxyAutoRight
RegWrite($CONSTKEYAUTO, "DefaultConnectionSettings", "REG_BINARY", $proxyAutoWrite)
RegWrite($CONSTKEYPROXY, "ProxyEnable", "REG_DWORD", "00000001")
RegWrite($CONSTKEYPROXY, "ProxyServer", "REG_SZ", "proxy:80")
RegWrite($CONSTKEYPROXY, "ProxyOverride", "REG_SZ", "192.168.*;<local>")
DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0)
EndSelect
;GUIDelete($guiProxy)
ProxySetup()
EndFunc ;==>_DefaultButton
Func _AsShown()
;ProxySetup()
Select
Case GUICtrlRead($chkBxAutoDetect) = $GUI_UNCHECKED And GUICtrlRead($chkBxAutoConfig) = $GUI_UNCHECKED
$autoConfigUrlWrite = ""
If $proxyAutoTemp = "03" Or $proxyAutoTemp = "0B" Or $proxyAutoTemp = "0F" Or $proxyAutoTemp = "07" Then
$proxyAutoTemp = "03"
ElseIf $proxyAutoTemp = "01" Or $proxyAutoTemp = "09" Or $proxyAutoTemp = "0D" Or $proxyAutoTemp = "05" Then
$proxyAutoTemp = "01"
EndIf
Case GUICtrlRead($chkBxAutoDetect) = $GUI_CHECKED And GUICtrlRead($chkBxAutoConfig) = $GUI_UNCHECKED
$autoConfigUrlWrite = ""
If $proxyAutoTemp = "03" Or $proxyAutoTemp = "0B" Or $proxyAutoTemp = "0F" Or $proxyAutoTemp = "07" Then
$proxyAutoTemp = "0B"
ElseIf $proxyAutoTemp = "01" Or $proxyAutoTemp = "09" Or $proxyAutoTemp = "0D" Or $proxyAutoTemp = "05" Then
$proxyAutoTemp = "09"
EndIf
Case GUICtrlRead($chkBxAutoDetect) = $GUI_CHECKED And GUICtrlRead($chkBxAutoConfig) = $GUI_CHECKED
$autoConfigUrlWrite = GUICtrlRead($inpAutoConfig)
If $proxyAutoTemp = "03" Or $proxyAutoTemp = "0B" Or $proxyAutoTemp = "0F" Or $proxyAutoTemp = "07" Then
$proxyAutoTemp = "0F"
ElseIf $proxyAutoTemp = "01" Or $proxyAutoTemp = "09" Or $proxyAutoTemp = "0D" Or $proxyAutoTemp = "05" Then
$proxyAutoTemp = "0D"
EndIf
Case GUICtrlRead($chkBxAutoDetect) = $GUI_UNCHECKED And GUICtrlRead($chkBxAutoConfig) = $GUI_CHECKED
$autoConfigUrlWrite = GUICtrlRead($inpAutoConfig)
If $proxyAutoTemp = "03" Or $proxyAutoTemp = "0B" Or $proxyAutoTemp = "0F" Or $proxyAutoTemp = "07" Then
$proxyAutoTemp = "07"
ElseIf $proxyAutoTemp = "01" Or $proxyAutoTemp = "09" Or $proxyAutoTemp = "0D" Or $proxyAutoTemp = "05" Then
$proxyAutoTemp = "05"
EndIf
Case Else
EndSelect
If GUICtrlRead($chkBxProxyLan) = $GUI_CHECKED Then
$proxyEnableWrite = "00000001"
$proxyServer = GUICtrlRead($inpProxyServer) & ":" & GUICtrlRead($inpPort)
$proxyOverride = GUICtrlRead($inpBypassAdd) & ";<local>"
$proxyAutoLeft = StringLeft($proxyAutoSettings, 18)
$proxyAutoRight = StringMid($proxyAutoSettings, 21)
$proxyAutoWrite = $proxyAutoLeft & $proxyAutoTemp & $proxyAutoRight
RegWrite($CONSTKEYAUTO, "DefaultConnectionSettings", "REG_BINARY", $proxyAutoWrite)
RegWrite($CONSTKEYPROXY, "ProxyEnable", "REG_DWORD", $proxyEnableWrite)
RegWrite($CONSTKEYPROXY, "ProxyServer", "REG_SZ", $proxyServer)
RegWrite($CONSTKEYPROXY, "ProxyOverride", "REG_SZ", $proxyOverride)
RegWrite($CONSTKEYPROXY, "AutoConfigUrl", "REG_SZ", $autoConfigUrlWrite)
MsgBox(1,"设置","成功")
ElseIf GUICtrlRead($chkBxProxyLan) = $GUI_UNCHECKED Then
$proxyEnableWrite = "00000000"
$proxyAutoLeft = StringLeft($proxyAutoSettings, 18)
$proxyAutoRight = StringMid($proxyAutoSettings, 21)
$proxyAutoWrite = $proxyAutoLeft & $proxyAutoTemp & $proxyAutoRight
RegWrite($CONSTKEYAUTO, "DefaultConnectionSettings", "REG_BINARY", $proxyAutoWrite)
RegWrite($CONSTKEYPROXY, "ProxyEnable", "REG_DWORD", $proxyEnableWrite)
RegWrite($CONSTKEYPROXY, "AutoConfigUrl", "REG_SZ", $autoConfigUrlWrite)
MsgBox(1,"设置","取消设置")
EndIf
$s=DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0)
MsgBox(1,@error,$s)
;GUIDelete($guiProxy)
;ProxySetup()
EndFunc ;==>_AsShown
Func _AutoConfig_Check()
Local $IsChecked = GUICtrlRead($chkBxAutoConfig)
If $IsChecked = 1 Then
GUICtrlSetState($inpAutoConfig, $GUI_ENABLE)
Else ; $IsChecked = 4
GUICtrlSetState($inpAutoConfig, $GUI_DISABLE)
EndIf
EndFunc ;==>_AutoConfig_Checked
Func _ProxyLan_Check()
$IsChecked = GUICtrlRead($chkBxProxyLan)
If $IsChecked = 1 Then
GUICtrlSetState($inpBypassAdd, $GUI_ENABLE)
GUICtrlSetState($inpProxyServer, $GUI_ENABLE)
GUICtrlSetState($inpPort, $GUI_ENABLE)
GUICtrlSetState($chkBxBypass, $GUI_ENABLE)
Else
GUICtrlSetState($inpBypassAdd, $GUI_DISABLE)
GUICtrlSetState($inpProxyServer, $GUI_DISABLE)
GUICtrlSetState($inpPort, $GUI_DISABLE)
GUICtrlSetState($chkBxBypass, $GUI_DISABLE)
EndIf
EndFunc ;==>_ProxyLan_Clicked```
木有头像就木JJ啦!还木有头像吗?点这里申请属于你的个性Gravatar头像吧!
老弟,这段代码如何检测socks5代理速度!