在Z-BLOG可使用的新版ASP的GIF验证码[V70404]
发布时间:2023-09-11 12:56:20 所属栏目:Asp教程 来源:
导读:复制下面代码,存为c_validcode.asp上传到function下就可以了
复制代码 代码如下:
<%@ CODEPAGE=65001 %>
<%
'///////////////////////////////////////////////////////////////////////////////
'/
复制代码 代码如下:
<%@ CODEPAGE=65001 %>
<%
'///////////////////////////////////////////////////////////////////////////////
'/
复制下面代码,存为c_validcode.asp上传到function下就可以了 复制代码 代码如下: <%@ CODEPAGE=65001 %> <% '/////////////////////////////////////////////////////////////////////////////// '// Z-Blog '// 作 者: 朱煊(zx.asd),sipo '// 版权所有: RainbowSoft Studio '// 技术支持: rainbowsoft@163.com '// 单元名称: c_validcode.asp '// 开始时间: 2007-4-4 '// 最后修改: 2007-4-4 '// 备 注: www.dc9.cn '/////////////////////////////////////////////////////////////////////////////// %> <% Option Explicit %> <% On Error Resume Next %> <!-- #include file="../c_option.asp" --> <!-- #include file="../function/c_function.asp" --> <% '.VerifyCode GetVerifyNumber, False Class Com_GifCode_Class Public Noisy, Count, Width, Height, Angle, Offset, Border Private Graph(), Margin(3) Private Sub Class_Initialize() Randomize Noisy = 7 ' 干扰点出现的概率 Count = 5 ' 字符数量 Width = 60 ' 图片宽度 Height = 20 ' 图片高度 Angle = 3 ' 角度随机变化量 Offset = 10 ' 偏移随机变化量 Border = 2 ' 边框大小 End Sub Public Function Create(str) Dim i Dim vIndex ReDim Graph(Width-1, Height-1) For i = 0 To Count - 1 vIndex=CInt(Mid(str,i+1,1)-1) SetDraw vIndex, i Next End Function Sub SetDot(pX, pY) If pX * (Width-pX-1) >= 0 And pY * (Height-pY-1) >= 0 Then Graph(pX, pY) = 1 End If End Sub Public Sub SetDraw(pIndex, pNumber) ' 字符数据字典 If pIndex=-1 Then pIndex=9 Dim DotData(9) DotData(0) = Array(30, 15, 50, 1, 50, 100) DotData(1) = Array(1 ,34 ,30 ,1 ,71, 1, 100, 34, 1, 100, 93, 100, 100, 86) DotData(2) = Array(1, 1, 100, 1, 42, 42, 100, 70, 50, 100, 1, 70) DotData(3) = Array(100, 73, 6, 73, 75, 6, 75, 100) DotData(4) = Array(100, 1, 1, 1, 1, 50, 50, 35, 100, 55, 100, 80, 50, 100, 1, 95) DotData(5) = Array(100, 20, 70, 1, 20, 1, 1, 30, 1, 80, 30, 100, 70, 100, 100, 80, 100, 60, 70, 50, 30, 50, 1, 60) DotData(6) = Array(6, 26, 6, 6, 100, 6, 53, 100) DotData(7) = Array(100, 30, 100, 20, 70, 1, 30, 1, 1, 20, 1, 30, 100, 70, 100, 80, 70, 100, 30, 100, 1, 80, 1, 70, 100, 30) DotData(8) = Array(1, 80, 30, 100, 80, 100, 100, 70, 100, 20, 70, 1, 30, 1, 1, 20, 1, 40, 30, 50, 70, 50, 100, 40) DotData(9) = Array(100, 20, 70, 1, 20, 1, 1, 30, 1, 80, 30, 100, 70, 100, 100, 80, 100, 60, 90, 20, 80,3 (编辑:汽车网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐