|
-
Dec 12th, 2012, 04:08 PM
#1
Thread Starter
Junior Member
[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
-
Dec 12th, 2012, 05:46 PM
#2
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()
-
Dec 12th, 2012, 07:00 PM
#3
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.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Dec 12th, 2012, 08:16 PM
#4
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.
-
Dec 13th, 2012, 02:10 PM
#5
Thread Starter
Junior Member
Re: [HELP] VB6 Captcha Verifier
i'm sorry i still can't do it the full code, any help?
-
Dec 13th, 2012, 03:22 PM
#6
Thread Starter
Junior Member
Re: [HELP] VB6 Captcha Verifier
-
Dec 13th, 2012, 03:47 PM
#7
Re: [HELP] VB6 Captcha Verifier
Why don't you reply to questions? Like mine in post 3
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Dec 13th, 2012, 04:18 PM
#8
Thread Starter
Junior Member
Re: [HELP] VB6 Captcha Verifier
 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:
Dim Var as String
Var = "123"
?
Last edited by DumperJet; Dec 13th, 2012 at 04:21 PM.
-
Dec 13th, 2012, 04:46 PM
#9
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?)
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Dec 15th, 2012, 11:57 AM
#10
Thread Starter
Junior Member
Re: [HELP] VB6 Captcha Verifier
 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
-
Dec 15th, 2012, 12:16 PM
#11
Re: [HELP] VB6 Captcha Verifier
You are as clear as mud. I guess you don't really care about help with your captcha verifier
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|