Componentless verification code generation - GIF format
The code copy is as follows:
<%
OptionExplicit' display statement
ClassCom_GifCode_Class
'''''''''''''''''''''''''''''''''''''''''''''
'Author:[email protected](QQ)
'Thanks:Laomi,Laomiao,NetRube
'2006-01-02
'''''''''''''''''''''''''''''''''''''''''''''
PublicNoisy, Count, Width, Height, Angle, Offset, Border
PrivateGraph(), Margin(3)
PrivateSubClass_Initialize()
Randomize
Noisy=16' probability of interference point occurrence
Count=4' characters
Width=80' picture width
Height=20'Picture height
Angle=2' Random Angle Change
Offset=20' Offset Random Change Quantity
Border=1'Border Size
EndSub
PublicFunctionCreate()
ConstcCharSet="123456789"
Dimi,x,y
DimvValidCode:vValidCode=""
DimvIndex
ReDimGraph(Width-1,Height-1)
Fori=0ToCount-1
vIndex=Int(Rnd*Len(cCharSet))
vValidCode=vValidCode+Mid(cCharSet,vIndex+1,1)
SetDrawvIndex,i
Next
Create=vValidCode
EndFunction
SubSetDot(pX,pY)
IfpX*(Width-pX-1)>=0AndpY*(Height-pY-1)>=0Then
Graph(pX,pY)=1
EndIf
EndSub
PublicSubSetDraw(pIndex,pNumber)
'Character data
DimDotData(8)
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,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)