Jump to content

Error on


Recommended Posts

(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.

Thanks

My code:

#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 by vampirevn01
Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...