首页 美女贴图 网络日记 重庆租房 搜索指南 网络电视 飘网音乐 飘网博客 精彩网址 友情链接 飘网地图 本站留言
飘网中国
专题:网络营销 | 网站设计 | QQ技巧 | 搜索优化 | 菜鸟进阶 | 病毒攻防 | 网络技术 | 系统应用 | 本站作品 | 常用软件 | 工具软件 |
飘网中国>>网站设计>>正文

无组件生成验证码:GIF格式的asp代码

编辑:admin 来源: 更新:2006-12-29 点击:
【字体:

摘要:无组件生成验证码:GIF格式的asp代码:第一版使用了数字+字母,但是第二版的安全性已经大大提高,已经不需要再使用字母,因为数字“0”和字母“o”容易混杂,所以也把数字“0”取消了,总之一句话,一切为了用户。
关键字:验证码 GIF 
正文:
255) & ChrB(255) 

Response.BinaryWrite ChrB(0) & ChrB(85) & ChrB(255) 

' 图象标识符 
Response.BinaryWrite ChrB(Asc(",")) 

Response.BinaryWrite ChrB(0) & ChrB(0) & ChrB(0) & ChrB(0) 
' 图象宽度 
Response.BinaryWrite ChrB(Width Mod 256) & ChrB((Width \ 256) Mod 256) 
' 图象高度 
Response.BinaryWrite ChrB(Height Mod 256) & ChrB((Height \ 256) Mod 256) 

Response.BinaryWrite ChrB(0) & ChrB(7) & ChrB(255) 

Dim x, y, i : i = 0 
For y = 0 To Height - 1 
For x = 0 To Width - 1 
If Rnd < Noisy / 100 Then 
Response.BinaryWrite ChrB(1-Graph(x, y)) 
Else 
If x * (x-Width) = 0 Or y * (y-Height) = 0 Then 
Response.BinaryWrite ChrB(Graph(x, y)) 
Else 
If Graph(x-1, y) = 1 Or Graph(x, y) Or Graph(x, y-1) = 1 Then 
Response.BinaryWrite ChrB(1) 
Else 
Response.BinaryWrite ChrB(0) 
End If 
End If 
End If 
If (y * Width + x + 1) Mod 126 = 0 Then 
Response.BinaryWrite ChrB(128) 
i = i + 1 
End If 
If (y * Width + x + i + 1) Mod 255 = 0 Then 
If (Width*Height - y * Width - x - 1) > 255 Then 
Response.BinaryWrite ChrB(255) 
Else 
Response.BinaryWrite ChrB(Width * Height Mod 255) 
End If 
End If 
Next 
Next 
Response.BinaryWrite ChrB(128) & ChrB(0) & ChrB(129) & ChrB(0) & ChrB(59) 
End Sub 
End Class 

Dim mCode 
Set mCode = New Com_GifCode_Class 
Session("GetCode") = mCode.Create() 
mCode.Output() 
Set mCode = Nothing 

    '''''''''''''''''''''''''''''''''''''''''''''
    ' Author: Layen support@ssaw.net 84815733(QQ)
    ' Thanks: Laomi, Laomiao, NetRube
    '                                  2006-01-02
    '''''''''''''''''''''''''''''''''''''''''''''
%> 

[1][2][3]
上一篇:ASP代码:生成可变长/随机彩色验证码(BMP)
下一篇:百度网页搜索原则,发生变化!
最新文章 更多
推荐文章 更多
热门文章 更多
© 2005-2010 飘网中国 版权所有
站长邮箱:①LCC-749AT163.com ②FlymornATgmail.com(AT改为@)
如转载时,请注明出处;本站部分资源来自网络,如有侵权,请来信说明;飘易文章系统 HTML版.
渝ICP备05000119号