无为清净楼资源网 Design By www.qnjia.com
复制下面代码,存为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)
Dim vExtent : vExtent = Width / Count
Margin(0) = Border + vExtent * (Rnd * Offset) / 100 + Margin(1)
Margin(1) = vExtent * (pNumber + 1) - Border - vExtent * (Rnd * Offset) / 100
Margin(2) = Border + Height * (Rnd * Offset) / 100
Margin(3) = Height - Border - Height * (Rnd * Offset) / 100
Dim vStartX, vEndX, vStartY, vEndY
Dim vWidth, vHeight, vDX, vDY, vDeltaT
Dim vAngle, vLength
vWidth =Int(Margin(1) - Margin(0))
vHeight =Int(Margin(3) - Margin(2))
vStartX = Int((DotData(pIndex)(0)-1) * vWidth / 100)
vStartY = Int((DotData(pIndex)(1)-1) * vHeight / 100)
Dim i, j
For i = 1 To UBound(DotData(pIndex), 1)/2
If DotData(pIndex)(2*i-2) <> 0 And DotData(pIndex)(2*i) <> 0 Then
vEndX = (DotData(pIndex)(2*i)-1) * vWidth / 100
vEndY = (DotData(pIndex)(2*i+1)-1) * vHeight / 100
vDX = vEndX - vStartX
vDY = vEndY - vStartY
If vDX = 0 Then
vAngle = Sgn(vDY) * 3.14/2
Else
vAngle = Atn(vDY / vDX)
End If
If Sin(vAngle) = 0 Then
vLength = vDX
Else
vLength = vDY / Sin(vAngle)
End If
vAngle = vAngle + (Rnd - 0.5) * 2 * Angle * 3.14 * 2 / 100
vDX = Int(Cos(vAngle) * vLength)
vDY = Int(Sin(vAngle) * vLength)
If Abs(vDX) > Abs(vDY) Then vDeltaT = Abs(vDX) Else vDeltaT = Abs(vDY)
For j = 1 To vDeltaT
SetDot Margin(0) + vStartX + j * vDX / vDeltaT, Margin(2) + vStartY + j * vDY / vDeltaT
Next
vStartX = vStartX + vDX
vStartY = vStartY + vDY
End If
Next
End Sub
Public Sub Output()
Response.Expires = -9999
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-ctrol", "no-cache"
Response.ContentType = "image/gif"
Response.BinaryWrite ChrB(Asc("G")) & ChrB(Asc("I")) & ChrB(Asc("F"))
Response.BinaryWrite ChrB(Asc("8")) & ChrB(Asc("9")) & ChrB(Asc("a"))
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(128) & ChrB(0) & ChrB(0)
Response.BinaryWrite ChrB(250) & ChrB(250) & ChrB(250)
Response.BinaryWrite ChrB(0) & ChrB(0) & ChrB(0)
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))
ElseIf x * (x-Width) = 0 Or y * (y-Height) = 0 Then
Response.BinaryWrite ChrB(Graph(x, y))
ElseIf 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
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
Dim code
Set mCode = New Com_GifCode_Class
mCode.Create(GetVerifyNumber)
mCode.Output()
Set mCode = Nothing
%>
由于原验证码过于简单,导致zblogger们饱受垃圾评论与引用之苦,下一版本将集成该验证码。
该验证码是根据网络上流传的一个源代码修改而来。
另,近期新的反垃圾评论与引用工具将与大家见面。
复制代码 代码如下:
<%@ 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)
Dim vExtent : vExtent = Width / Count
Margin(0) = Border + vExtent * (Rnd * Offset) / 100 + Margin(1)
Margin(1) = vExtent * (pNumber + 1) - Border - vExtent * (Rnd * Offset) / 100
Margin(2) = Border + Height * (Rnd * Offset) / 100
Margin(3) = Height - Border - Height * (Rnd * Offset) / 100
Dim vStartX, vEndX, vStartY, vEndY
Dim vWidth, vHeight, vDX, vDY, vDeltaT
Dim vAngle, vLength
vWidth =Int(Margin(1) - Margin(0))
vHeight =Int(Margin(3) - Margin(2))
vStartX = Int((DotData(pIndex)(0)-1) * vWidth / 100)
vStartY = Int((DotData(pIndex)(1)-1) * vHeight / 100)
Dim i, j
For i = 1 To UBound(DotData(pIndex), 1)/2
If DotData(pIndex)(2*i-2) <> 0 And DotData(pIndex)(2*i) <> 0 Then
vEndX = (DotData(pIndex)(2*i)-1) * vWidth / 100
vEndY = (DotData(pIndex)(2*i+1)-1) * vHeight / 100
vDX = vEndX - vStartX
vDY = vEndY - vStartY
If vDX = 0 Then
vAngle = Sgn(vDY) * 3.14/2
Else
vAngle = Atn(vDY / vDX)
End If
If Sin(vAngle) = 0 Then
vLength = vDX
Else
vLength = vDY / Sin(vAngle)
End If
vAngle = vAngle + (Rnd - 0.5) * 2 * Angle * 3.14 * 2 / 100
vDX = Int(Cos(vAngle) * vLength)
vDY = Int(Sin(vAngle) * vLength)
If Abs(vDX) > Abs(vDY) Then vDeltaT = Abs(vDX) Else vDeltaT = Abs(vDY)
For j = 1 To vDeltaT
SetDot Margin(0) + vStartX + j * vDX / vDeltaT, Margin(2) + vStartY + j * vDY / vDeltaT
Next
vStartX = vStartX + vDX
vStartY = vStartY + vDY
End If
Next
End Sub
Public Sub Output()
Response.Expires = -9999
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-ctrol", "no-cache"
Response.ContentType = "image/gif"
Response.BinaryWrite ChrB(Asc("G")) & ChrB(Asc("I")) & ChrB(Asc("F"))
Response.BinaryWrite ChrB(Asc("8")) & ChrB(Asc("9")) & ChrB(Asc("a"))
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(128) & ChrB(0) & ChrB(0)
Response.BinaryWrite ChrB(250) & ChrB(250) & ChrB(250)
Response.BinaryWrite ChrB(0) & ChrB(0) & ChrB(0)
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))
ElseIf x * (x-Width) = 0 Or y * (y-Height) = 0 Then
Response.BinaryWrite ChrB(Graph(x, y))
ElseIf 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
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
Dim code
Set mCode = New Com_GifCode_Class
mCode.Create(GetVerifyNumber)
mCode.Output()
Set mCode = Nothing
%>
由于原验证码过于简单,导致zblogger们饱受垃圾评论与引用之苦,下一版本将集成该验证码。
该验证码是根据网络上流传的一个源代码修改而来。
另,近期新的反垃圾评论与引用工具将与大家见面。
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
2024年11月16日
2024年11月16日
- 群星《2024好听新歌36》AI调整音效【WAV分轨】
- 梁朝伟.1986-朦胧夜雨裡(华星40经典)【华星】【WAV+CUE】
- 方芳.1996-得意洋洋【中唱】【WAV+CUE】
- 辛欣.2001-放120个心【上海音像】【WAV+CUE】
- 柏菲·万山红《花开原野1》限量开盘母带ORMCD[低速原抓WAV+CUE]
- 柏菲·万山红《花开原野2》限量开盘母带ORMCD[低速原抓WAV+CUE]
- 潘安邦《思念精选集全纪录》5CD[WAV+CUE]
- 杨千嬅《千嬅新唱金牌金曲》金牌娱乐 [WAV+CUE][985M]
- 杨钰莹《依然情深》首版[WAV+CUE][1G]
- 第五街的士高《印度激情版》3CD [WAV+CUE][2.4G]
- 三国志8重制版哪个武将智力高 三国志8重制版智力武将排行一览
- 三国志8重制版哪个武将好 三国志8重制版武将排行一览
- 三国志8重制版武将图像怎么保存 三国志8重制版武将图像设置方法
- 何方.1990-我不是那种人【林杰唱片】【WAV+CUE】
- 张惠妹.1999-妹力新世纪2CD【丰华】【WAV+CUE】