我想使用代理来掩盖我的 IP 上网自动浏览器!这是我的代码:
#NoTrayIcon
#include <GUIConstants.au3>
#Include <IE.au3>
#include <GUIConstantsEx.au3>
GUICreate("Web Browser By EMP£!!",800,600)
GUISetBkColor(0x808080)
GUISetState(@SW_SHOW)
$Edit=GUICtrlCreateInput("http://www.whatismyip.com/",20,20,500,20)
$Vai=GUICtrlCreateButton("SURF!!!",600,10,150,50)
$oIE = ObjCreate("Shell.Explorer.2")
GUICtrlCreateObj($oIE, 10, 90,780, 500)
$ret = HttpSetProxy(2,"61.163.78.51:3128")
If $ret == 0 Then
MsgBox(0, "Proxy", "Proxy Error")
Exit
EndIf
While 1
$msg=GUIGetMsg()
Switch $msg
Case $Vai
$Link=GUICtrlRead($Edit)
_IENavigate($oIE,($Link))
GUICtrlSetData($Edit,$Link)
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
我在 http://www.whatismyip.com/上导航,我可以看到我的真实IP地址!我想隐藏代理!
HttpSetProxy
函数仅适用于InetGet
,它对IE浏览器的设置没有区别。为了为IE浏览器窗口创建代理,您需要更改IE浏览器设置。
我会这样做的方式是这样的:
#include <GUIConstants.au3>
#include <IE.au3>
#include <GUIConstantsEx.au3>
Global Const $sInetSettingsKey = "HKCUSoftwareMicrosoftWindowsCurrentVersionInternet Settings"
GUICreate("Web Browser By EMP£!!", 800, 600)
GUISetBkColor(0x808080)
GUISetState(@SW_SHOW)
$Edit = GUICtrlCreateInput("http://www.whatismyip.com/", 20, 20, 500, 20)
$Vai = GUICtrlCreateButton("SURF!!!", 600, 10, 150, 50)
$oIE = ObjCreate("Shell.Explorer.2")
GUICtrlCreateObj($oIE, 10, 90, 780, 500)
MySetProxy("61.163.78.51:3128")
While 1
$msg = GUIGetMsg()
Switch $msg
Case $Vai
$Link = GUICtrlRead($Edit)
_IENavigate($oIE, ($Link))
GUICtrlSetData($Edit, $Link)
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
MySetProxy()
Func MySetProxy($sProxy = "", $fEnable = True)
Local Static $sPrev = ""
Local Static $fWasEnabled = False
If $sProxy = "" Then
If $sPrev <> "" Then __setProxyInfo($fWasEnabled, $sPrev)
Else
If $sPrev = "" Then
$sPrev = RegRead($sInetSettingsKey, "ProxyServer")
$fWasEnabled = RegRead($sInetSettingsKey, "ProxyEnable")
EndIf
__setProxyInfo($fEnable, $sProxy)
EndIf
EndFunc
Func __setProxyInfo($fEnabled, $sProxy)
RegWrite($sInetSettingsKey, "ProxyEnable", "REG_DWORD", 1)
RegWrite($sInetSettingsKey, "ProxyServer", "REG_SZ", $sProxy)
EndFunc
不过whatismyip.com
不太喜欢它。但是IP地址肯定改变了。