vampirevn01 0 Posted April 15, 2009 Share Posted April 15, 2009 (edited) (Sorry about topic title, I can't edit to "Can't load URL in IE Embedded")I was code a tool use socks in a file Socks.txt to connect to google.com.But have problem:If file Socks.txt have 2 Socks5 (working all)But this tool can check only first Socks. With other Socks5, IE Embedded can't load http://google.com again.Please help me fix it.ThanksMy code:expandcollapse popup#include <WindowsConstants.au3> #include <Process.au3> #include <File.au3> #include <GUIConstantsEx.au3> #include <IE.au3> #Include <GuiEdit.au3> #include <ComboConstants.au3> #include <ButtonConstants.au3> Global $DungSocks,$Running,$FILE1,$FILE2,$FILE3,$Y,$ALLSOCKS,$E,$VTS,$IN_Y,$IN_TONGSOCKS Opt("GUIOnEventMode", 1) _IEErrorHandlerRegister () $OIE = _IECreateEmbedded () GUICreate("TEST", 640, 490, _ (@DesktopWidth - 640) / 2, (@DesktopHeight - 490) / 2, _ $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) GUICtrlCreateLabel("TEST", 190, 10, 260, 20) $GUIActiveX = GUICtrlCreateObj($OIE, 10, 40, 620, 350) $FSOCKS = "Socks.txt" ;File socks is Socks.txt If Not _FILEREADTOARRAY($FSOCKS, $ALLSOCKS) Then MsgBox(4096, "Error", "Can't open file " & $FSOCKS, 60) ;If found file socks then get all socks to array $ALLSOCKS exit EndIf Func USESOCKS() ;Function Get Socks If $Y >= $ALLSOCKS[0] Then ;If don't have more Socks then Exit $Tamdung = MsgBox(1, "Error", "Don't have more Socks in this file", 60) Exit Else ;If have more Socks $Y = $Y + 1 ;Inc $Y $SOCKS = $ALLSOCKS[$Y] ;Get Socks with new $Y RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", "REG_SZ", "socks=" & $SOCKS) ;Set Socks to IE MsgBox(4096, "Wait", "Curent Socks is: " & $SOCKS, 60) CHECKIP() ;Check Socks EndIf EndFunc Func CHECKIP() ;Function Check Socks TrayTip("Testing", "CheckingIP", 10) _RunDos("RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255") ;Delte IE files ... While ProcessExists("RunDll32.exe") ;Wait until delete copleted Sleep(500) WEnd _IENAVIGATE($OIE, "http://google.com") ;Load google.com _IELOADWAIT($OIE) ;Wait until copleted $SHTML = _IEDOCREADHTML($OIE) ;View HTML source code $RESULT1 = StringInStr($SHTML, "google") ;Find string "google" in HTML source If $RESULT1 = 0 Then ;If Result1 = 0 then this Socks die MsgBox(4096, "Error", "Can't connect to Google. I will try againt with next Socks", 60) USESOCKS() ;Get next Socks to check Else ;If Result1 > 0 then Socks live MsgBox(4096, "OK", "Connected to Google.", 60) EndIf EndFunc USESOCKS() While 1 sleep(100) WEnd Edited April 15, 2009 by vampirevn01 Link to post Share on other sites
vampirevn01 0 Posted April 15, 2009 Author Share Posted April 15, 2009 Please help me T_T Link to post Share on other sites
Moderators Melba23 3,799 Posted April 15, 2009 Moderators Share Posted April 15, 2009 vampirevn01, Please remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. Be patient and someone will answer eventually. Or if not - tough! ;-) M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to post Share on other sites
vampirevn01 0 Posted April 16, 2009 Author Share Posted April 16, 2009 Sorry, my program have Error :If file Socks.txt like this:One Socks5 dieOne Socks5 livethen after checked Socks5 die, Can't load Google.com again with live socks.The function _IENAVIGATE($OIE, "http://google.com") don't work again . Link to post Share on other sites
Authenticity 15 Posted April 16, 2009 Share Posted April 16, 2009 Interesting way to see if you're connected to the internet. ;] Why don't you just ping google to see if you're connected? Link to post Share on other sites
vampirevn01 0 Posted April 16, 2009 Author Share Posted April 16, 2009 This is my problem too, but do you know how to using Command Line with Socks to PING google.com or using Internet Explorer to PING google.com ? Link to post Share on other sites
vampirevn01 0 Posted April 17, 2009 Author Share Posted April 17, 2009 Hey every body, I know why my program have Error. Because when I using RegWrite to edit IE setting, the current _IECreateEmbedded DON'T re read this setting again, so IE can't load new socks. This is my problem. Please help me, how to IE reload setting or how to reset the _IECreateEmbedded function. Thanks Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now