Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27212

VS 2013 Fill form and check was sent successfully

$
0
0
Hello everyone

I am developing an application to fill out forms on websites. But I have a problem. I get that the form is filled and sent well but, checking if sent either not working properly.

The web form has 2 fields. One is captcha text and type. When "submit" occurs anywhere shows a message that is well padded. The web or recharge or change. Change your HTML code. My code is set when charging is complete and that causes can not check instantly. I give you the code if I can help:

Code:

Imports mshtml


Public Class Form1
    Private urls() As String = {"http://www.canhasbitcoin.com/index.php", "http://www.freebtc4all.com/index.php",
                                "http://www.virtualfaucet.com/index.php", "http://www.thefreebitcoins.com/index.php",
                                "http://www.freebitcoins.me/index.php", "http://www.thebitcoin.me/index.php",
                                "http://www.rawbitcoins.com/index.php", "http://www.srbitcoin.com/index.php",
                                "http://www.nioctib.net/index.php", "http://www.greencoins.org/index.php",
                                "http://www.btcmine.net/index.php", "http://www.bitcats.net/index.php",
                                "http://www.bitcoinspain.net/index.php", "http://www.bitcoins4free.me/index.php",
                                "http://www.freebitcoins4u.com/index.php", "http://www.fr33bitcoins.com/index.php",
                                "http://www.faucetbtc.com/index.php", "http://www.btc4you.com/index.php",
                                "http://www.elbitcoingratis.es/index.php"}

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        WebBrowser1.Navigate(urls(My.Settings.index))
        WebBrowser1.AllowNavigation = True
        My.Settings.Reload()

        If My.Settings.index > 18 Then
            My.Settings.index = 0
        End If

    End Sub


    Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted


        Label2.Text = WebBrowser1.Url.ToString()



        vercaptcha()






    End Sub



    Private Sub vercaptcha()
        For Each Captcha As HtmlElement In WebBrowser1.Document.Images

            If Captcha.GetAttribute("src").Contains("http://www.google.com/recaptcha/api/image?") Then
                PictureBox1.Load(Captcha.GetAttribute("src"))
            End If
        Next
    End Sub





    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

        Try
            WebBrowser1.Document.GetElementById("recaptcha_response_field").InnerText = TextBox1.Text
            WebBrowser1.Document.GetElementById("btcaddr").InnerText = Dialog1.TextBox2.Text
            WebBrowser1.Document.Forms(0).InvokeMember("submit")
        Catch ex As Exception
            MsgBox("No se puede enviar los datos al formulario. Intentando con otra web")
            My.Settings.index = My.Settings.index + 1
            WebBrowser1.Navigate(urls(My.Settings.index))
        End Try



        TextBox1.Clear()


       


    End Sub

    Private Sub PictureBox3_Click(sender As Object, e As EventArgs) Handles PictureBox3.Click

        WebBrowser1.Navigate("javascript:Recaptcha.reload ();") 'Runs the Captcha Reload function

        'MsgBox("Se ha refrescado el captcha :)", MsgBoxStyle.OkOnly, "Nuevo captcha")



        Timer1.Start()



       
    End Sub

    Private Sub PictureBox5_Click(sender As Object, e As EventArgs) Handles PictureBox5.Click
        AboutBox1.Show()

    End Sub




    Private Sub ToolStripButton1_Click(sender As Object, e As EventArgs) Handles ToolStripButton1.Click
        Dialog1.Show()
    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs)

    End Sub






    Private Sub Timer1_Tick_1(sender As Object, e As EventArgs) Handles Timer1.Tick

        vercaptcha()
    End Sub


    Private Sub TextBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles TextBox1.KeyDown
        If e.KeyCode = Keys.Enter Then

            Try
                WebBrowser1.Document.GetElementById("recaptcha_response_field").InnerText = TextBox1.Text
                WebBrowser1.Document.GetElementById("btcaddr").InnerText = Dialog1.TextBox2.Text
                WebBrowser1.Document.Forms(0).InvokeMember("submit")
            Catch ex As Exception
                MsgBox("No se puede enviar los datos al formulario. Intentando con otra web")
                My.Settings.index = My.Settings.index + 1
                WebBrowser1.Navigate(urls(My.Settings.index))
            End Try

           



            TextBox1.Clear()

           
        End If
    End Sub

    Private Sub WebBrowser1_ProgressChanged(sender As Object, e As WebBrowserProgressChangedEventArgs) Handles WebBrowser1.ProgressChanged
        If WebBrowser1.DocumentText.Contains("Wrong captcha") Then
            Label4.Text = "Wrong captcha"
        End If

        If WebBrowser1.DocumentText.Contains("Success! You'll receive our payment soon.") Then
            My.Settings.index = My.Settings.index + 1
            WebBrowser1.Navigate(urls(My.Settings.index))
        End If

        If WebBrowser1.DocumentText.Contains("you can get more bitcoins here") Then
            My.Settings.index = My.Settings.index + 1
            WebBrowser1.Navigate(urls(My.Settings.index))
        End If
 
    End Sub
End Class


PS: Use google translator. I'm not good with English.

Viewing all articles
Browse latest Browse all 27212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>