一个非常简洁的验证码程序(转载)

原创 2004年10月26日 11:40:00

<%
Response.Buffer = True
With Response
.Expires = -1
.AddHeader "Pragma","no-cache"
.AddHeader "cache-ctrol","no-cache"
End With
Dim a(10,10)

a(0,1) = "0x3c" '数字0
a(0,2) = "0x66"
a(0,3) = "0xc3"
a(0,4) = "0xc3"
a(0,5) = "0xc3"
a(0,6) = "0xc3"
a(0,7) = "0xc3"
a(0,8) = "0xc3"
a(0,9) = "0x66"
a(0,10)= "0x3c"

a(1,1) = "0x18" '数字1
a(1,2) = "0x1c"
a(1,3) = "0x18"
a(1,4) = "0x18"
a(1,5) = "0x18"
a(1,6) = "0x18"
a(1,7) = "0x18"
a(1,8) = "0x18"
a(1,9) = "0x18"
a(0,10)= "0x7e"

a(2,1) = "0x3c" '数字2
a(2,2) = "0x66"
a(2,3) = "0x60"
a(2,4) = "0x60"
a(2,5) = "0x30"
a(2,6) = "0x18"
a(2,7) = "0x0c"
a(2,8) = "0x06"
a(2,9) = "0x06"
a(2,10)= "0x7e"

a(3,1) = "0x3c" '数字3
a(3,2) = "0x66"
a(3,3) = "0xc0"
a(3,4) = "0x60"
a(3,5) = "0x1c"
a(3,6) = "0x60"
a(3,7) = "0xc0"
a(3,8) = "0xc0"
a(3,9) = "0x66"
a(3,10)= "0x38"

a(4,1) = "0x38" '数字4
a(4,2) = "0x3c"
a(4,3) = "0x36"
a(4,4) = "0x33"
a(4,5) = "0x33"
a(4,6) = "0x33"
a(4,7) = "0xff"
a(4,8) = "0x30"
a(4,9) = "0x30"
a(4,10)= "0xfe"

a(5,1) = "0xfe" '数字5
a(5,2) = "0xfe"
a(5,3) = "0x06"
a(5,4) = "0x06"
a(5,5) = "0x3e"
a(5,6) = "0x60"
a(5,7) = "0xc0"
a(5,8) = "0xc3"
a(5,9) = "0x66"
a(5,10)= "0x3c"

a(6,1) = "0x60" '数字6
a(6,2) = "0x30"
a(6,3) = "0x18"
a(6,4) = "0x0c"
a(6,5) = "0x3e"
a(6,6) = "0x63"
a(6,7) = "0xc3"
a(6,8) = "0xc3"
a(6,9) = "0x66"
a(6,10) ="0x3c"

a(7,1) = "0xff" '数字7
a(7,2) = "0xc0"
a(7,3) = "0x60"
a(7,4) = "0x30"
a(7,5) = "0x18"
a(7,6) = "0x18"
a(7,7) = "0x18"
a(7,8) = "0x18"
a(7,9) = "0x18"
a(7,10)= "0x18"

a(8,1) = "0x3c" '数字8
a(8,2) = "0x66"
a(8,3) = "0xc3"
a(8,4) = "0x66"
a(8,5) = "0x3c"
a(8,6) = "0x66"
a(8,7) = "0xc3"
a(8,8) = "0xc3"
a(8,9) = "0x66"
a(8,10)= "0x3c"

a(9,1) = "0x3c" '数字9
a(9,2) = "0x66"
a(9,3) = "0xc3"
a(9,4) = "0xc3"
a(9,5) = "0x66"
a(9,6) = "0x3c"
a(9,7) = "0x18"
a(9,8) = "0x0c"
a(9,9) = "0x06"
a(9,10)= "0x03"
Dim num
Randomize
num = Int(7999 * Rnd + 2000)
Session("safenum") = num
Dim Image
Dim Width, Height
Dim digtal
Dim Length
Dim sort
Dim hc
Length = 4
hc = chr(13) & chr(10)
Redim sort(Length)
digital = ""
For I = 1 To Length - Len(num)
digital = digital & "0"
Next
For I = 1 To Len(num)
digital = digital & Mid(num, I, 1)
Next
For I = 1 To Len(digital)
sort(I) = Mid(digital, I, 1)
Next
Width = 8 * Len(digital)
Height = 10
Response.ContentType = "image/x-xbitmap"
Image = "#define counter_width " & Width & hc
Image = Image & "#define counter_height " & Height & hc
Image = Image & "static unsigned char counter_bits[] = {" & hc
For I = 1 To Height
For J = 1 To Length
Image = Image & a(sort(J),I) & ","
Next
Next
Image = Left(Image, Len(Image) - 1)
Image = Image & "};" & hc
Response.Write Image
%>

一个非常简洁的验证码程序(转载)

Response.Buffer = TrueWith Response.Expires = -1.AddHeader "Pragma","no-cache".AddHeader "cache-ctro...
  • caobin518
  • caobin518
  • 2006年03月06日 09:52
  • 541

一个非常简洁的验证码程序

 Response.Buffer = TrueWith Response.Expires = -1.AddHeader "Pragma","no-cache".AddHeader "cache-ctr...
  • swazn_yj
  • swazn_yj
  • 2007年04月10日 11:18
  • 1423

[ASP]一个非常简洁的验证码程序

Response.Buffer = TrueWith Response.Expires = -1.AddHeader "Pragma","no-cache".AddHeader "cache-ctro...
  • bgu
  • bgu
  • 2004年10月26日 14:24
  • 654

简单图片验证码

1.将验证码作为一个jsp页面显示,并用图片进行加载                                 onclick="javascript:document.getElemen...
  • afdasfggasdf
  • afdasfggasdf
  • 2017年12月28日 22:26
  • 30

python argparse用法总结

转载自: http://www.jianshu.com/p/fef2d215b91dargparse介绍是python的一个命令行解析包,非常编写可读性非常好的程序参数分类 positional ar...
  • u010472607
  • u010472607
  • 2017年08月17日 12:05
  • 144

一个漂亮的php验证码类(分享)

直接上代码: 复制代码 代码如下: //验证码类 class ValidateCode {  private $charset = 'abcdefghkmnprstuvwxyzABCDEF...
  • bfboys
  • bfboys
  • 2016年10月19日 21:43
  • 921

代码编写简洁之道

“代码重复分为两种:模块内重复和模块间重复。无论何种重复,都在一定程度上说明了程序员的水平有问题。”  —— 秦迪 这是烂代码系列的第二篇,在文章中我会跟大家讨论一下如何尽可能高效和客观的评价代...
  • u011001084
  • u011001084
  • 2016年01月30日 22:28
  • 338

简洁的asp无组件验证码生成程序

Response.Buffer = TrueWith Response.Expires = -1.AddHeader "Pragma","no-cache".AddHeader "cache-ctro...
  • liuhao2046xp
  • liuhao2046xp
  • 2005年12月17日 11:50
  • 514

一个非常简洁高效的JS右键菜单!

function csMenu(_object, _menu){ this.IEventHander = null; this.IFrameHander = null; this.I...
  • lesen
  • lesen
  • 2008年05月30日 11:52
  • 1195

自定义View_一个非常简洁的柱状图

快过年了,提前祝大家新年快乐哦。马上就可以闲下来休息几天了,好幸福啊。。。不多说了,最近项目中有个地方要用柱状图显示客户的消费情况,本着一名程序员的优秀品质,上gitbub上连续搜罗了有关画图的,不得...
  • u013762572
  • u013762572
  • 2017年01月14日 16:30
  • 828
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:一个非常简洁的验证码程序(转载)
举报原因:
原因补充:

(最多只允许输入30个字)