|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
结论:和PHP一样,ASP简单而易于维护,很适合小型网站应用,通过DCOM和MTS技术,ASP甚至还可以完成小规模的企业应用,但ASP的致命缺点就是不支持跨平台的系统,在大型项目开发和维护上非常困难。考证码示例:
<p><%
ifisempty(session("getcode"))orsession("getcode")ucase(request.form("form_code"))then
response.write"考证码输出毛病"
response.end
else
session("getcode")=empty"清空session
response.write"考证码输出准确"
response.end
endif
%>
[/code]考证码代码:
<p><%
optionexplicit"显现声明
classcom_gifcode_class
"""""""""""""""""""""""""""""""""""""""""""""
"author:layensupport@ssaw.net84815733(qq)
"thanks:laomi,laomiao,netrube
"2006-01-02
"""""""""""""""""""""""""""""""""""""""""""""
publicnoisy,count,width,height,angle,offset,border
privategraph(),margin(3)
privatesubclass_initialize()
randomize
noisy=16"搅扰点呈现的几率
count=4"字符数目
width=80"图片宽度
height=20"图片高度
angle=2"角度随机变更量
offset=20"偏移随机变更量
border=1"边框巨细
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)
"字符数据
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,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)
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/count
margin(0)=border+vextent*(rnd*offset)/100+margin(1)
margin(1)=vextent*(pnumber+1)-border-vextent*(rnd*offset)/100
margin(2)=border+height*(rnd*offset)/100
margin(3)=height-border-height*(rnd*offset)/100
dimvstartx,vendx,vstarty,vendy
dimvwidth,vheight,vdx,vdy,vdeltat
dimvangle,vlength
vwidth=int(margin(1)-margin(0))
vheight=int(margin(3)-margin(2))
"肇端坐标
vstartx=int((dotdata(pindex)(0)-1)*vwidth/100)
vstarty=int((dotdata(pindex)(1)-1)*vheight/100)
dimi,j
fori=1toubound(dotdata(pindex),1)/2
ifdotdata(pindex)(2*i-2)0anddotdata(pindex)(2*i)0then
"尽头坐标
vendx=(dotdata(pindex)(2*i)-1)*vwidth/100
vendy=(dotdata(pindex)(2*i+1)-1)*vheight/100
"横向差异
vdx=vendx-vstartx
"纵向差异
vdy=vendy-vstarty
"倾斜角度
ifvdx=0then
vangle=sgn(vdy)*3.14/2
else
vangle=atn(vdy/vdx)
endif
"两坐标间隔
ifsin(vangle)=0then
vlength=vdx
else
vlength=vdy/sin(vangle)
endif
"随机动弹角度
vangle=vangle+(rnd-0.5)*2*angle*3.14*2/100
vdx=int(cos(vangle)*vlength)
vdy=int(sin(vangle)*vlength)
ifabs(vdx)>abs(vdy)thenvdeltat=abs(vdx)elsevdeltat=abs(vdy)
forj=1tovdeltatASP最大的缺点在于网络的安全性和可靠性,企业将经营数据放在开放的平台上,最大的担忧就是如何保证这些数据不被其他人破坏。 |
|