im tried to make a vb creator to create account but how to show the captcha in my form? please teach me how to do it. Thank you.

Dani AI

Generated

Hi — cannot help with automating creation of Google/Gmail accounts or bypassing their security (that would violate Google’s terms and may be unlawful). See Google’s Terms of Service for the “don’t abuse our services / creating fake accounts” guidance. Google Terms of Service. (policies.google.com)

If the goal is learning how to show a CAPTCHA image inside a VB2010 WinForms registration form (your own app), use a safe, local approach: generate a random string, keep the correct value server- or app-side, render that string to a Bitmap with some noise/lines, show it in a PictureBox, then compare the typed value (case-insensitive) and expire/limit attempts. As suggested, WinForms has no built-in CAPTCHA control, so either use a third-party control or draw your own image. Example (VB):

Private rand As New Random()
Private currentCaptcha As String

Private Function GenerateCaptchaText(length As Integer) As String
    Const chars As String = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789"
    Dim sb As New System.Text.StringBuilder(length)
    For i As Integer = 1 To length
        sb.Append(chars(rand.Next(chars.Length)))
    Next
    Return sb.ToString()
End Function

Private Sub RenderCaptcha()
    currentCaptcha = GenerateCaptchaText(6)
    Dim bmp As New Bitmap(200, 60)
    Using g As Graphics = Graphics.FromImage(bmp)
        g.Clear(Color.White)
        Using f As New Font("Arial", 28, FontStyle.Bold)
            g.DrawString(currentCaptcha, f, Brushes.Black, 10, 5)
        End Using
        For i As Integer = 1 To 5
            Using pen As New Pen(Color.FromArgb(rand.Next(80,200), rand.Next(256), rand.Next(256)))
                g.DrawLine(pen, rand.Next(bmp.Width), rand.Next(bmp.Height), rand.Next(bmp.Width), rand.Next(bmp.Height))
            End Using
        Next
    End Using
    Dim oldImg = PictureBox1.Image
    PictureBox1.Image = bmp
    If oldImg IsNot Nothing Then oldImg.Dispose()
End Sub

Notes: dispose old images to avoid GDI leaks; if generating off the UI thread set the PictureBox image via Invoke; clear or rotate the captcha after success; use short expiry and attempt limits to reduce replay. If using Google’s reCAPTCHA you must host the widget in a web page (or use the mobile SDK) and embed that page (WebBrowser) in your app — reCAPTCHA is not a native WinForms control. reCAPTCHA docs. (developers.google.com)

Recommended Answers

All 3 Replies

web application? are you using any third party control for captcha?

thanks for reply. i want to create gmail account auto creator for windows application but the captcha image i want it to show in my vb2010 form how to do it?

There is no built in controls i guess. you may need to look for third party controls or write your own. using random string generation...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.