[HELP] VB6 Captcha Verifier
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
Re: [HELP] VB6 Captcha Verifier
What are you trying to verify? The user's input? Just compare it to the "txt" parameter you passed to MakeCaptchaImage()
Re: [HELP] VB6 Captcha Verifier
I'm assuming that your MakeCaptchaImage function works. So you create the captcha image and display it on a Web page or whatever and the image will have some kind of text string embedded into it for which the user must copy and type into a textbox. Well, like Lenggries stated, you just compare what the user typed in to a value in your app (a string variable, I assume) that contains the correct text. Is this your problem or does it go beyond what is being said to you? Maybe your problem is how do you get the text the user typed in off the Web page perhaps, I don't know how you are handling this.
Re: [HELP] VB6 Captcha Verifier
Web page?
I was assuming he was protecting a real program in VB6 against window-hijacker programs. My fix is to use windowless controls as much as possible - nothing to be exploited, at least not easily.
Re: [HELP] VB6 Captcha Verifier
i'm sorry i still can't do it the full code, any help?
Re: [HELP] VB6 Captcha Verifier
Re: [HELP] VB6 Captcha Verifier
Why don't you reply to questions? Like mine in post 3
Re: [HELP] VB6 Captcha Verifier
Quote:
Originally Posted by
jmsrickland
Why don't you reply to questions? Like mine in post 3
Sorry
first: i didn't see your post.
second: i'm a freakenly newbie here man
It's Kinda helpfull your post but, it is 829 students can it be more randomizable? Are u meaning this:
Quote:
Dim Var as String
Var = "123"
?
Re: [HELP] VB6 Captcha Verifier
No, I was talking about how you get the captcha text that the user entered and see if it is the same text on your captcha(verifying, isn't that your question?)
Re: [HELP] VB6 Captcha Verifier
Quote:
Originally Posted by
jmsrickland
No, I was talking about how you get the captcha text that the user entered and see if it is the same text on your captcha(verifying, isn't that your question?)
Well some human eyes and inject the string that will do
Re: [HELP] VB6 Captcha Verifier
You are as clear as mud. I guess you don't really care about help with your captcha verifier