資源描述:
《ASP程序無組件生成驗(yàn)證碼》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、ASP程序無組件生成驗(yàn)證碼 一、無組件生成驗(yàn)證碼-GIF格式<%OptionExplicit'顯示聲明ClassCom_GifCode_Class''''''''''''''''''''''''''''''''''''''''''''''Author:Layensupport@ssaw.net84815733(QQ)'Thanks:Laomi,Laomiao,NetRube'2006-01-02'''''''''''''''''''''''''''''''''''''''''''''PublicNoisy,Count,Width,Height,Angle,Offset,Bor
2、derPrivateGraph(),Margin(3)PrivateSubClass_Initialize()RandomizeNoisy=16'干擾點(diǎn)出現(xiàn)的概率Count=4'字符數(shù)量Width=80'圖片寬度Height=20'圖片高度Angle=2'角度隨機(jī)變化量Offset=20'偏移隨機(jī)變化量Border=1'邊框大小EndSubPublicFunctionCreate()ConstcCharSet="123456789"Dimi,x,yDimvValidCode:vValidCode=""DimvIndexReDimGraph(Width-1,Height-1)Fo
3、ri=0ToCount-1vIndex=Int(Rnd*Len(cCharSet))vValidCode=vValidCode+Mid(cCharSet,vIndex+1,1)SetDrawvIndex,iNextCreate=vValidCodeEndFunctionSubSetDot(pX,pY)IfpX*(Width-pX-1)>=0AndpY*(Height-pY-1)>=0ThenGraph(pX,pY)=1EndIfEndSubPublicSubSetDraw(pIndex,pNumber)'字符數(shù)據(jù)DimDotData(8)DotData(0)=Array(30,
4、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
5、,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)DimvExtent:vExtent=Width/CountMargin(0)=
6、Border+vExtent*(Rnd*Offset)/100+Margin(1)Margin(1)=vExtent*(pNumber+1)-Border-vExtent*(Rnd*Offset)/100Margin(2)=Border+Height*(Rnd*Offset)/100Margin(3)=Height-Border-Height*(Rnd*Offset)/100DimvStartX,vEndX,vStartY,vEndYDimvWidth,vHeight,vDX,vDY,vDeltaTDimvAngle,vLengthvWidth=Int(Margin(1)-Ma
7、rgin(0))vHeight=Int(Margin(3)-Margin(2))'起始坐標(biāo)vStartX=Int((DotData(pIndex)(0)-1)*vWidth/100)vStartY=Int((DotData(pIndex)(1)-1)*vHeight/100)Dimi,jFori=1ToUBound(DotData(pIndex),1)/2IfDotData(pIndex)(2*i-2)<>0AndDotData(pIndex)(2*i)<>0Then'終點(diǎn)坐標(biāo)vEndX=(