Copy the following code, save it as c_validcode.asp and upload it to function
The code copy is as follows:
<%@CODEPAGE=65001%>
<%
'///////////////////////////////////////////////////////////////////////////////
'//Z-Blog
'//Author: Zhu Xuan (zx.asd), sipo
'//Copyright: RainbowSoftStudio
'//Technical Support: [email protected]
'//Unit name: c_validcode.asp
'//Start time: 2007-4-4
'//Last modified: 2007-4-4
'//Note: www.dc9.cn
'///////////////////////////////////////////////////////////////////////////////
%>
<%OptionExplicit%>
<%OnErrorResumeNext%>
<!--#includefile="../c_option.asp"-->
<!--#includefile="../function/c_function.asp"-->
<%
'.VerifyCodeGetVerifyNumber,False
ClassCom_GifCode_Class
PublicNoisy, Count, Width, Height, Angle, Offset, Border
PrivateGraph(), Margin(3)
PrivateSubClass_Initialize()
Randomize
Noisy=7' probability of interference point occurrence
Count=5' characters
Width=60' picture width
Height=20'Picture height
Angle=3' Random Angle Change
Offset=10' Offset Random Change Quantity
Border=2'Border Size
EndSub
PublicFunctionCreate(str)
Dimi
DimvIndex
ReDimGraph(Width-1,Height-1)
Fori=0ToCount-1
vIndex=CInt(Mid(str,i+1,1)-1)
SetDrawvIndex,i
Next
EndFunction
SubSetDot(pX,pY)
IfpX*(Width-pX-1)>=0AndpY*(Height-pY-1)>=0Then
Graph(pX,pY)=1
EndIf
EndSub
PublicSubSetDraw(pIndex,pNumber)
'Character Data Dictionary
IfpIndex=-1ThenpIndex=9
DimDotData(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)