|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
ASP一般认为只能运行在IIS上,正如前面所提到的,这并不是十分正确,事实上,ASP也能运行在Apache上。ApacheASP可在任意Apache服务器上运行有限的ASP功能,所需做的,只需打开mod_perl。程序|考证码 记得“想昔时”某天上午在这里途经,看到一名伴侣贴的本人写的考证码程序,固然他的程序是口角有杂点,但实在很简单被破解的,但却有很多人喜好着。。。没举措,当世界午研讨了一翻BMP图片,然后就写出了这些代码,只是现在没有发布,眼看明天这么多好人乱在良多论坛上注册用户来发告白,以是才贴出来共享一下。
本考证码天生程序特性以下:
1、黑色;
2、BMP图象色深为16位,天生的图片体积更小;(4位长的考证码只要几百字节)
3、长度可自界说;(1位至25位可流动设置,也能够本人改成静态)
4、背景正色深度可自界说;
详细请看代码
注:代码中并没有针对动网的设置考证码Session的中央。想用的伴侣本人依据必要改一下,地位就在代码中呈现Session("Num")的那一行,改成本人必要的称号就能够了。这个考证码也能够用在任何必要考证码的中央。不必在动网论坛也可。
上面是代码部分:
<--r>OptionExplicit
Response.Expires=0
Response.AddHeader"Pragma","no-cache"
Response.AddHeader"cache-ctrol","no-cache"
Response.ContentType="Image/BMP"
RandomizeTimer
DimText_Data(9),Text_Len,Int_Temp(),I,j,k,Int_Temp2
*****参数设置区*****
Text_Len=4考证码长度(撑持1-25位)
**********************
ReDimInt_Temp(Text_Len-1)
Text_Data(0)="00000000000001111000001100110000110111000011011100001100110000111011000011101100001100110000011110000000000000"
Text_Data(1)="00000000000000011000000011100000111110000000011000000001100000000110000000011000000001100000000110000000000000"
Text_Data(2)="00000000000001111000001100110000110011000000001100000001100000001100000001100000001100000000111111000000000000"
Text_Data(3)="00000000000001111000001100110000110011000000001100000011100000000011000011001100001100110000011110000000000000"
Text_Data(4)="00000000000001100000000110000000011011000001101100000110110000110011000011111110000000110000000011000000000000"
Text_Data(5)="00000000000011111100001100000000110000000011000000001111100000000011000000001100000001100000111100000000000000"
Text_Data(6)="00000000000000111000000011000000011000000011111000001100110000110011000011001100001100110000011110000000000000"
Text_Data(7)="00000000000011111100000000110000000110000000011000000011000000001100000001100000000110000000011000000000000000"
Text_Data(8)="00000000000001111000001100110000110011000011101100000111100000110111000011001100001100110000011110000000000000"
Text_Data(9)="00000000000001111000001100110000110011000011001100001100110000011111000000011000000011000000011100000000000000"
上面随机天生列位考证码
Session("Num")=""
ForI=0ToText_Len-1
Int_Temp(I)=Int(Rnd*10)
Session("Num")=Session("Num")+Mid("0123456789",Int_Temp(I)+1,1)
Next
上面输入文件头部分
Int_Temp2=(Text_Len-1)4*220+((Text_Len-1)/4-(Text_Len-1)4*4)*44
Response.BinaryWriteChrB(&H42)&ChrB(&H4D)
Response.BinaryWriteChrB(((Int_Temp2+206)/256-(Int_Temp2+206)256)*256)&ChrB((Int_Temp2+206)256)特别位
Response.BinaryWriteChrB(0)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(&H76)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(&H28)&ChrB(0)&ChrB(0)&ChrB(0)
Response.BinaryWriteChrB(Text_Len*10)特别位
Response.BinaryWriteChrB(0)&ChrB(0)&ChrB(0)&ChrB(&HB)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(&H1)&ChrB(0)&ChrB(&H4)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(0)
Response.BinaryWriteChrB(((Int_Temp2+88)/256-(Int_Temp2+88)256)*256)&ChrB((Int_Temp2+88)256)特别位
Response.BinaryWriteChrB(0)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(16)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(16)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(&H80)&ChrB(0)&ChrB(0)&ChrB(&H80)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(&H80)&ChrB(&H80)&ChrB(0)&ChrB(&H80)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(&H80)&ChrB(0)&ChrB(&H80)&ChrB(0)
Response.BinaryWriteChrB(&H80)&ChrB(&H80)&ChrB(0)&ChrB(0)&ChrB(&H80)&ChrB(&H80)&ChrB(&H80)&ChrB(0)&ChrB(&HC0)&ChrB(&HC0)&ChrB(&HC0)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(&HFF)&ChrB(0)&ChrB(0)&ChrB(&HFF)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(&HFF)&ChrB(&HFF)&ChrB(0)&ChrB(&HFF)&ChrB(0)&ChrB(0)&ChrB(0)&ChrB(&HFF)&ChrB(0)&ChrB(&HFF)&ChrB(0)&ChrB(&HFF)&ChrB(&HFF)&ChrB(0)&ChrB(0)&ChrB(&HFF)&ChrB(&HFF)&ChrB(&HFF)&ChrB(0)
上面输入图片数据
Fori=10to0Step-1
Forj=0toText_Len-1
Fork=1to9Step2
IfMid(Text_Data(Int_Temp(j)),i*10+k,1)="0"ThenInt_Temp2=Get_BackColor()*16ElseInt_Temp2=Get_ForeColor()*16
IfMid(Text_Data(Int_Temp(j)),i*10+k+1,1)="0"ThenInt_Temp2=Int_Temp2+Get_BackColor()ElseInt_Temp2=Int_Temp2+Get_ForeColor()
Response.BinaryWriteChrB(Int_Temp2)
Next
Next
Int_Temp2=(Text_Len/4-Text_Len4)*4
SelectCaseInt_Temp2
Case1
Response.BinaryWriteChrB(0)&ChrB(0)&ChrB(0)
Case2
Response.BinaryWriteChrB(0)&ChrB(0)
Case3
Response.BinaryWriteChrB(0)
EndSelect
Next
FunctionGet_BackColor()
失掉一个背景致
IfInt(Rnd*30)=0Then注:此处的Rnd*30是决意背景正色的几,值越年夜,则正色越少,图片越简单看分明
Get_BackColor=CInt(Mid("00021209",Int(Rnd*4)*2+1,2))
Else
Get_BackColor=CInt(Mid("081515151515",Int(Rnd*6)*2+1,2))
EndIf
EndFunction
FunctionGet_ForeColor()
失掉一个远景色
Get_ForeColor=CInt(Mid("00021209",Int(Rnd*4)*2+1,2))
EndFunction优点:简单易学、开发速度快、有很多年“历史”,能找到非常多别人做好的程序来用、配合activeX功能强大,很多php做不到的asp+activeX能做到,例如银行安全控件 |
|