Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[TuToRiAl] How to make Offline (No Internet) Captcha (Human Confirmation) [TuToRiAl]
#1
A CAPTCHA or Captcha (pronounced /ˈkæptʃə/) is a type of challenge-response test used in computing to ensure that the response is not generated by a computer. The process usually involves one computer (a server) -- WOW, WOW, WOW. A SERVER??? |||||| asking a user to complete a simple test which the computer is able to generate and grade.

Welcome to my tutorial on how to generate Captcha without using pictures, internet connection or anything external that the application has to access; as long as you get a human response? Correct? I believe so. Today I will show you a nice feature that almost every computer can do in the world, generate a random number!... -.-'



We will be using that method in our captcha, and the best part about offline captcha in a VB form my way, is that there is NO need to refresh it for the following reasons:
  • Unreadable Letters
  • Long and Pointless Words
  • Never loaded correctly
  • Half the Captcha loaded


_____________________________________________


Lets proceed. First open a form up, and have the following created:

  • 3 Buttons
  • 3 Reasonable Icons for Refresh, Close, and Confirm/Submit User Input, if you want to be fancy.
  • 3 TextBoxes
  • Ability to follow my Tutorial Victoire

1. Now Open up VB6, VB8, VB9, VB10 or whatever... Roflmao

2. Select new project, WindowsApplication...

3. Name it whatever you want, etc...

4. Add the following above. And now for the pre-step.

5. Each Button should be named, Generate New Captcha Offline, Submit New Captcha Offline, and Exit Captcha Offline.

6. One of Each textbox should have the following values: >Enter Captcha Number Here<, 999999999, and Nothing as in Blank. Make the Blank one big and obvious so they know what to enter as Captcha.

---

Now for the Code.

PublicClass + Form1_Load:
Code:
Public Class Form1
    Dim charactersDisallowed As String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,<>./?; :'{}[]=+-_)(*&^%$#@!~`|\uç▲ìα▲╜KÄ╤ZlÆ╘¦«¨©÷ ¢¡¬­®¯°±²³´µ¶·¸¹£¤¥»¼½¾¿"
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        KeyPreview = True
        Try
            Dim Random As New Random
            TextBox1.Text = Random.Next(TextBox2.Text)
        Catch ex As Exception
            MsgBox("Invalid Characters/No Numerical Value Detected", 16, "Fatal Error")
        End Try
        TextBox2.Visible = False 'This is what gives a digit limit for random captcha.
TextBox1.Enabled = False 'Disables TextBox so User cannot copy and paste the captcha.
        TextBox1.ReadOnly = True 'Disables so user cannot edit the captcha.
    End Sub

Generate New Captcha Button Code:

Code:
Dim Random As New Random
        TextBox1.Text = Random.Next(TextBox2.Text)

Submit Captcha Button Code:
Code:
If TextBox3.Text = TextBox1.Text Then
            MsgBox("Captcha entered successfuly!", 64, "Human Detected!")
            'Other Code should be put here if the user enters the captcha correctly, like Form2.Show()
        Else
            MsgBox("Your Kind is Not wanted Here, Robot!", 48, "Robot Detected!")
            'here add code that tells the user they have entered it incorrectly, I called them a robot for fun.
        End If

Exit Captcha Button Code:
Code:
End

Captcha Input TextBox (Where you put the captcha):
Code:
Dim theText As String = TextBox3.Text
        Dim Letter As String

        For x As Integer = 0 To TextBox3.Text.Length - 1
            Letter = TextBox3.Text.Substring(x, 1)
            If charactersDisallowed.Contains(Letter) Then
                theText = theText.Replace(Letter, String.Empty)
            End If
        Next
        TextBox3.Text = theText
        TextBox3.Select(TextBox3.Text.Length, 0)

Captcha Input TextBox (Auto Submit Captcha on Enter Key):
Code:
Private Sub TextBox3_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox2.KeyDown
        If e.KeyCode = Keys.Enter Then
            Button3_Click(Nothing, Nothing)
        End If
    End Sub

In the end, it should look somewhat like this:

[Image: dosxv8.png]

FINALIZED RESULTS!!!


[Image: 2dhbrqt.png]

[Image: e8jvp5.jpg]

Download the Application as an Example

Enjoy and don't forget to say thanks... Your all very welcome in advanced!

For:
ѕмии™, he gave me an idea by posting his tutorial!
[Image: t5BWm.png]
Reply


Messages In This Thread
[TuToRiAl] How to make Offline (No Internet) Captcha (Human Confirmation) [TuToRiAl] - by Resistance - 11-06-2010, 06:16 PM
Response! - by Resistance - 08-30-2012, 10:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how to display google captcha picture on form and add to textbox hit ok to bypass polas 0 1,180 09-14-2012, 01:59 PM
Last Post: polas
  [HELP]Tutorial/Learning System[HELP] norBATman 2 1,092 09-08-2012, 10:17 PM
Last Post: AceInfinity
  [VB.Net] Simple captcha class [Commented][Noob/Friendly] The-One 18 8,553 09-08-2012, 04:20 PM
Last Post: spesificrelax
  [Visual Basic] FTP Uploader [Tutorial] Coding Support 6 2,736 08-12-2012, 12:36 AM
Last Post: Kenneth
  [RELEASE]SF-TutPad "Tutorial Editor" [RELEASE] Digital-Punk 28 8,701 08-11-2012, 11:25 PM
Last Post: Kenneth

Forum Jump:


Users browsing this thread: 1 Guest(s)