The
Changes the validation code to an addition operation, such as the verification code display "25+64 equals?" , then enter "91" to pass validation.
Look at the effect chart contrast: Character verification Code: → Addition Verification code:
Advantages:
① compared with the pure character verification Code, this procedure prevents the majority of (more than 99%) advertising machine automatic recognition. Even the Chinese verification code can be identified by some of the advertising machines in the market.
② with the Chinese authentication code, avoids the user to enter the user name password authentication code needs to switch input method trouble.
Description: This program requires web space to support AspJpeg components, italics _gb2312 fonts. The
code is as follows:
<% Const FONTCOLOR = &h000000 ' font Color const bgcolor = &HFFCCFF ' background color call Creatvalidcode ("GetCode") Sub CREATV Alidcode (PSN) Dim x, Jpeg Randomize x = Array (1+int (Rnd () *9), int (Rnd () *10), 1+int (Rnd () *9), int (Rnd () *10), 0, 0, "+ ") x (4) = x (0) *10 + x (1) x (5) = x (2) *10 + x (3) ' session (PSN) = CStr (Eval (x (4) & X (6) & X (5))] Session (PSN) = CStr (x (4) + x (5)) Set Jpeg = Server.CreateObject ("Persits.jpeg") jpeg.new 100,20,bgcolor jpeg.quality=100 with Jpeg.canvas. Font.Bold = True. Font.Size = 16. font.rotation = 0. font.family = "Italics _gb2312". Font.Color = FontColor. Printtext 4, 3, CSTR (x (0)). Printtext 3, CSTR (x (1)). Printtext, 3, X (6). Printtext, 3, CStr (x (2)). Printtext 3, CStr (x (3)). Font.rotation = 15. Printtext 55, 3, "et". Printtext 70, 3, "on". Printtext 85, 3, "? "End with" Disables caching Response.ContentType = "Image/jpeg" Response.Expires = -9999 response.addheader "Pragma", "No-cache "Response.AddHeader", "Cache-ctrol", "No-cache" Response.AddHeader "content-disposition", "inline"; Filename=vcode.jpg "Jpeg.sendbinary jpeg.close Set Jpeg = Nothing End Sub%>
The above is about ASP to implement the key code of the addition verification code, interested friends, can also be extended for other operations, such as multiplication, subtraction, and so on, I hope this article for everyone's learning help.