次のコードをコピーして、c_validcode.aspとして保存し、機能にアップロードします
コードコピーは次のとおりです。
<%@codepage = 65001%>
<%
'////////////////////////////////////////////////////////////
'// z-blog
'//著者:Zhu Xuan(ZX.ASD)、SIPO
'// Copyright:RainbowsoftStudio
'//テクニカルサポート:[email protected]
'//ユニット名:c_validcode.asp
'//開始時間:2007-4-4
'//最終修正:2007-4-4
'//注:www.dc9.cn
'////////////////////////////////////////////////////////////
%>
<%optionexplicit%>
<%onerrorresumenext%>
<! - #includefile = "../ c_option.asp" - >
<! - #includefile = "../ function/c_function.asp" - >
<%
'.verifyCodeGetVerifyNumber、false
classcom_gifcode_class
publicNoisy、カウント、幅、高さ、角度、オフセット、境界線
privategraph()、マージン(3)
privatesubclass_initialize()
ランダム化
noisy = 7 '干渉点が発生する確率
count = 5 '文字
幅= 60 '画像幅
高さ= 20'picture height
角度= 3 'ランダムな角度の変化
オフセット= 10 'オフセットランダム変更数量
Border = 2'borderサイズ
Endingub
publicFunctionCreate(str)
ディミ
dimvindex
Redimgraph(width-1、height-1)
fori = 0tocount-1
vindex = cint(mid(str、i+1,1)-1)
SetDrawvindex、i
次
エンド機能
SubsetDot(PX、PY)
ifpx*(width-px-1)> = 0andpy*(height-py-1)> = 0then
グラフ(PX、PY)= 1
endif
Endingub
publicsubsetdraw(Pindex、pnumber)
'文字データ辞書
ifpindex = -1thenpindex = 9
dimdotdata(9)
dotdata(0)= array(30,15,50,1,50,100)
dotdata(1)=配列(1,34,30,1,71,1,1,100,34,1,100,93,100,100,86)
dotdata(2)= array(1,1,100,1,42,42,100,70,50,100,1,70)