[HELP]Captcha Problem!

Posts 1–13 of 13 · Page 1 of 1
[HELP]Captcha Problem!
I have a Captcha problem. Blubb1337 have helped me very much! He did get everything to work, exept to show the picture in the picture box.

Code:
Private Sub wb_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles wb.DocumentCompleted
        'If wb.Document.Body.InnerHtml.Contains("Skriv inn de hvite symbolene du ser på bildet:") Then
        '    MsgBox("Antibot! Trykk Antibot, og slå inn antiboten")
        '    Dim captcha1 As HtmlElement
        '    captcha1 = wb.Document.GetElementById("Antibot")
        '    Dim path As String = captcha1.GetAttribute("src")
        '    TextBoxX3.Text = path
        '    Dim TextFile As New StreamWriter("test.html")
        '    TextFile.WriteLine("" & "<img src=" & TextBoxX3.Text & "id" & "=" & "Antibot" & " >")
        '    TextFile.Close()
        '    wb1.Navigate("/test.html")
        '    Dim captcha2 As HtmlElement
        '    captcha2 = wb.Document.GetElementById("Antibot")
        '    Dim path2 As String = captcha2.GetAttribute("src")
        '    PictureBox1.ImageLocation = path2
        'End If

        If wb.DocumentText.Contains("antibot.php?PHPSESSID=") Then
            Dim curcaptcha As String = Sb(wb.DocumentText, "<img src=""antibot.php?PHPSESSID=", """ alt=""Antibot"" />")
            Dim totalcaptcha As String = "antibot.php?PHPSESSID=" & curcaptcha
           
        
            Dim textfile2 As New StreamWriter("test2.html")
            textfile2.WriteLine("<img src=" & totalcaptcha & "id" & "=" & "graph_players" & " >")
            textfile2.Close()
            wb1.Navigate("/test2.html")

            Dim fullurl As String = "http://elitecrimes.net/" & totalcaptcha
            PictureBox1.ImageLocation = fullurl

            Try
                Dim playersgraph2 As HtmlElement
                playersgraph2 = wb1.Document.GetElementById("graph_players")

                Dim pathi4 As String = playersgraph2.GetAttribute("src")
                PictureBox1.ImageLocation = pathi4
            Catch
            End Try
        End If
        '	<td align=center><img src="antibot.php?PHPSESSID=48305a5764c76cb7d9fa1ef5379d8fb4" alt="Antibot" /></td>
    End Sub
Anyone knows why the Captcha wont show up in the picturebox?
Please help if you know!

Prfction
This one works I'm pretty sure.

[php]
Public Sub getcaptcha()
Dim capurl As String
Dim inner1 As String = Me.WebBrowser1.Document.Body.InnerHtml

Dim inner As String = inner1
Dim findStart As String, pulledOut As String
findStart = "properties="
Dim start As Integer, [end] As Integer
start = inner.IndexOf(findStart)
inner = inner.Remove(0, start + findStart.Length)
[end] = inner.IndexOf("""")
inner = inner.Remove([end], inner.Length - [end])
pulledOut = inner
capurl = ""
capurl = ("http://passport.nexon.net/Registration/FormShieldHttpHandler.aspx?__formShieldID=captchaF S&generate=image&properties=") & pulledOut

Me.PictureBox1.ImageLocation = capurl


End Sub
[/php]

Credits go to whoever wrote that, I think it might've been NextGen or someone. In any event, it wasn't me.

You'll have to replace the URL that I have there with whatever the captcha URL is of your page.

This was for a nexon passport generator I made ages ago
Quote Originally Posted by Jason View Post
This one works I'm pretty sure.

[php]
Public Sub getcaptcha()
Dim capurl As String
Dim inner1 As String = Me.WebBrowser1.Document.Body.InnerHtml

Dim inner As String = inner1
Dim findStart As String, pulledOut As String
findStart = "properties="
Dim start As Integer, [end] As Integer
start = inner.IndexOf(findStart)
inner = inner.Remove(0, start + findStart.Length)
[end] = inner.IndexOf("""")
inner = inner.Remove([end], inner.Length - [end])
pulledOut = inner
capurl = ""
capurl = ("http://passport.nexon.net/Registration/FormShieldHttpHandler.aspx?__formShieldID=captchaF S&generate=image&properties=") & pulledOut

Me.PictureBox1.ImageLocation = capurl


End Sub
[/php]

Credits go to whoever wrote that, I think it might've been NextGen or someone. In any event, it wasn't me.

You'll have to replace the URL that I have there with whatever the captcha URL is of your page.

This was for a nexon passport generator I made ages ago

yes and now for EU...please?
Quote Originally Posted by rayhvh View Post
yes and now for EU...please?
[php] Dim theElementCollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("img")



For Each curElement As HtmlElement In theElementCollection
Dim imgURL As String = curElement.GetAttribute("src").ToString
If imgURL.Contains("http://passport.nexoneu.com/img/") Then
PictureBox1.imagelocation = imgURL
Timer1.Stop()
End If

Next[/php]
yes and now...do not copy & paste..please?
Yeah, I wrote that, The horrible vb coder
Quote Originally Posted by NextGen1 View Post
Yeah, I wrote that, The horrible vb coder
Define "wrote" noob. Just just copy & pasted it from one of your developers in your company. You know it, we know it...damn copy & pasta.

@topic, picturebox1.imagelocation = fullurl doesn't work :[ Woulda been to easy
See if I ever help you again...




Send me link, Ill see what one of my guys can do, cause obviously I would waste payroll on MPGH....

Quote Originally Posted by NextGen1 View Post
See if I ever help you again...



*joins in*




Oh yeah NextGen...3k post ban?
mines basically the same as "zoom's"
put thit right under where it says public class form w/e
Code:
  Dim source_code As String = WebBrowser1.DocumentText
make a timer and add this code to it.
Code:
For Each Image As HtmlElement In WebBrowser1.Document.Images
            If Image.GetAttribute("src").Contains("BASE LINK OF THE CAPTCHA HERE!") Then
                Dim Web As New Net.WebClient
                PictureBox1.BackgroundImage = New Drawing.Bitmap(New IO.MemoryStream(Web.DownloadData(Image.GetAttribute("src"))))
            End If
        Next
then make a button and a textbox and add this code to the button.
Code:
WebBrowser1.Document.GetElementById("ID HERE!!!").SetAttribute("value", TextBox1.Text)
U CAN MAKE THE CAPTCHA IMAGE REFRESH SO IT GETS EVERY NEW CAPTCHA THAT POPS UP BUT THAT IS REALLY EASY so i wont post it.

if u give me the website i'll fill in the blanks for u so u can kinda c&p
The picturebox does not have an ID.
It was Calebb who wrote that little captcha snippet.

There are several other ways of doing it but his is most efficient.
Posts 1–13 of 13 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us