11-07-2010, 11:11 AM
(11-07-2010, 03:03 AM)ѕмии™ Wrote: You were right this is Nice
Can I use this and add a dew changes I will give Credits
Can we have a download for the Source over it did not work for me?
Umm... that was the source right there... Here is the whole code for form 1, right below:
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
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Random As New Random
TextBox1.Text = Random.Next(TextBox2.Text)
End Sub
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
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If TextBox3.Text = TextBox1.Text Then
MsgBox("Captcha entered successfuly!", 64, "Human?")
'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
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
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)
End Sub
End Class