Hi guys, i'm making a program with Captcha. And i'm stuck with the verify of the captcha can someone help me?
Code:
Private Sub MakeCaptchaImage(ByVal pic As PictureBox, ByVal _
txt As String, ByVal min_size As Integer, ByVal _
max_size As Integer)
Dim wid As Single
Dim hgt As Single
Dim ch_wid As Single
Dim i As Integer
Dim font_size As Single
Dim ch As String
Dim X As Single
Dim Y As Single
Dim prev_angle As Single
Dim angle As Single
Dim x1 As Single
Dim y1 As Single
Dim x2 As Single
Dim y2 As Single
wid = pic.ScaleWidth
hgt = pic.ScaleHeight
ch_wid = wid / Len(txt)
prev_angle = 0
pic.Cls
Randomize
For i = 1 To Len(txt)
ch = Mid$(txt, i, 1)
font_size = min_size + Rnd * (max_size - min_size)
X = (i - 0.75 + Rnd * 0.5) * ch_wid
Y = hgt / 2 + Rnd * (hgt - pic.ScaleY(font_size, _
vbPoints, vbTwips))
angle = prev_angle
Do While Abs(angle - prev_angle) < 10
angle = -20 + Rnd * (20 - -20)
Loop
prev_angle = angle
DrawCenteredRotatedText picCaptcha, ch, X, Y, _
angle, font_size
Next i
For i = 1 To 10
x1 = Rnd * wid
y1 = Rnd * hgt
x2 = Rnd * wid
y2 = Rnd * hgt
pic.Line (x1, y1)-(x2, y2)
Next i
For i = 1 To 10
x1 = Rnd * wid
y1 = Rnd * hgt
x2 = Rnd * wid
y2 = Rnd * hgt
pic.Line (x1, y1)-(x2, y2), vbWhite
Next i
End Sub
Private Sub VerifyCaptcha()
End Sub