คัดลอกรหัสต่อไปนี้บันทึกเป็น c_validcode.asp และอัปโหลดไปยังฟังก์ชัน
การคัดลอกรหัสมีดังนี้:
<%@codePage = 65001%>
-
-
'// z-blog
'// ผู้แต่ง: Zhu Xuan (zx.asd), sipo
'// ลิขสิทธิ์: RainbowsoftStudio
'// ฝ่ายสนับสนุนด้านเทคนิค: [email protected]
'// ชื่อหน่วย: c_validcode.asp
'// เวลาเริ่มต้น: 2007-4-4
'// แก้ไขล่าสุด: 2007-4-4
'// หมายเหตุ: www.dc9.cn
-
-
<%ตัวเลือก Explicit%>
<%onerrorresumenext%>
<!-#includefile = "../ c_option.asp"->
<!-#includefile = "../ function/c_function.asp"->
-
'.VerifyCodeGetVerifyNumber, FALSE
classcom_gifcode_class
สาธารณะ
PrivateGraph (), มาร์จิ้น (3)
Privatesubclass_initialize ()
สุ่ม
Noisy = 7 'ความน่าจะเป็นของการเกิดจุดรบกวนที่เกิดขึ้น
นับ = 5 'อักขระ
ความกว้าง = 60 'ความกว้างของรูปภาพ
ความสูง = 20'Picture ความสูง
มุม = 3 'การเปลี่ยนแปลงมุมสุ่ม
Offset = 10 'ปริมาณการเปลี่ยนแปลงแบบสุ่มแบบออฟเซ็ต
Border = 2'Border ขนาด
enddub
PublicFunctionCreate (STR)
Dimi
Dimvindex
Redimgraph (ความกว้าง -1, ความสูง -1)
fori = 0tocount-1
vindex = cint (mid (str, i+1,1) -1)
setDrawVindex, i
ต่อไป
endfunction
SubsetDot (PX, PY)
ifpx*(width-px-1)> = 0andpy*(ความสูง py-1)> = 0 แล้ว
กราฟ (px, py) = 1
endif
enddub
PublicsubsetDraw (Pindex, Pnumber)
'พจนานุกรมข้อมูลอักขระ
IFPINDEX = -1thenPindex = 9
Dimdotdata (9)
Dotdata (0) = อาร์เรย์ (30,15,50,1,50,100)
Dotdata (1) = อาร์เรย์ (1,34,30,1,71,1,100,34,1,100,93,100,100,86)
Dotdata (2) = อาร์เรย์ (1,1,100,1,42,42,100,70,50,100,1,1,70)