仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 527|回复: 8
打印 上一主题 下一主题

[学习教程] ASP网页设计编写一个asp代码实行器

[复制链接]
谁可相欹 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-16 22:30:51 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
因为ASP脚本语言非常简单,因此其代码也简单易懂,结合HTML代码,可快速地完成网站的应用程序。还无法完全实现一些企业级的功能:完全的集群、负载均横。保留为runasp.asp运转。账号暗码admin,上岸后输出代码便可实行了!!
<%@LANGUAGE="VBSCRIPT"%>
<%OptionExplicit
response.buffer=true
dimSpassword,SUserName
SUserName="admin"
Spassword="admin"
dimSQLMutiStr
dimi
dimaction
action=request.querystring("action")
IFaction="GetCode"then---------TOT
NumCodeJS
ELSE--------TOT
Response.Write("<!DOCTYPEHTMLPUBLIC""-//W3C//DTDHTML4.0Transitional//EN"">")
Response.Write("<HTML>")
Response.Write("<HEAD>")
Response.Write("<TITLE>ASPRunCodeSCRV1.0/CreateByPaintBlue.NetV37</TITLE>")
Response.Write("<METANAME=""Generator""CONTENT=""EditPlus,V37,PaintBlue.Net"">")
Response.Write("<METANAME=""Author""CONTENT=""V37,PaintBlue.Net"">")
Response.Write("<METANAME=""Keywords""CONTENT=""PaintBlue.Net,,V37,RunCode,ASP,Script,BlueIdea.COM,Lfgbox.com"">")
Response.Write("<METANAME=""Description""CONTENT=""运转ASP代码的ASP剧本!"">")
Response.Write("</HEAD>")
Response.Write("<BODYbgcolor=#D4D0C8>")
SQLMutiStr=trim(Request.Form("SQLMutiStr"))
ifsession("login")=""andaction="chkpass"then
session("login")=checkPass()
endif
ifaction="exit"thensession("login")=""
ifsession("login")="1"then
ifaction="RunCode"then
ifSQLMutiStr=""then
Response.write"没有输出要运转的代码!"
Response.write"<br><br><ahref=""javascript:window.history.back();"">前往运转页面</a><br><br>"
Response.write"<ahref=""?action=exit"">加入上岸</a>"
response.end
else
dimExeStrArr
dimre
dimtempSQL,tempSQL2
dimScriptArr,ScriptSubArr
tempSQL2=""
tempSQL=split(SQLMutiStr,vbcrlf)
ifinStr(lcase(tempSQL(0)),"language")>0then
tempSQL2=tempSQL(1)
ifubound(tempSQL)>1then
fori=1toubound(tempSQL)
tempSQL2=tempSQL2&tempSQL(i)
next
endif
tempSQL2=trim(tempSQL2)
else
tempSQL2=SQLMutiStr
endif
tempSQL2=replace(tempSQL2,"<%"&"=","<"&"%response.write")
do
tempSQL2=replace(tempSQL2,vbcrlf&vbcrlf,vbcrlf)
loopwhileinstr(tempSQL2,vbcrlf&vbcrlf)>0
tempSQL2=trim(tempSQL2)
tempSQL2="<"&"%%"&">"&tempSQL2&"<"&"%%"&">"
ScriptArr=split(tempSQL2,"%"&">")
dimub,kub
ub=ubound(ScriptArr)
fori=0toub-1
ScriptSubArr=split(ScriptArr(i),"<"&"%")
ifi>0thenresponse.write(ScriptSubArr(0))
ExeCuteIt(ScriptSubArr(1))
next
callEndProc("<fontcolor=#009900>代码运转终了!</font>")
endif
else
%>
输出要运转的ASP代码:
<FORMMETHOD=POSTACTION="?action=RunCode"style="margin:0px;">
<TEXTAREANAME="SQLMutiStr"wrap=OFFROWS="20"style="width:100%;height:100%;table-layout:fixed;word-break:break-all;"><%=Server.Htmlencode(SQLMutiStr)%></TEXTAREA>
<br>
<INPUTTYPE="button"Value="LouOut">
<INPUTTYPE="reset"Value="Clear">
<INPUTTYPE="submit"value="RunAspCode">
</FORM>
<%endif
else
callloginmain()
endif
Response.write("</BODY></HTML>")
ENDIF-------TOT
SUBloginMain()
%>
<FORMMETHOD=POSTACTION="?action=chkpass">UserName:<INPUTTYPE="text"NAME="UserName"><br>
PassWord:<INPUTTYPE="password"NAME="Runpassword"><br>
CheckCode:<INPUTTYPE="GetCode"NAME="GetCode"><imgsrc="runasp.asp?action=GetCode&Time=<%=timer()%>"><br>
<br><imgwidth=125height=0><INPUTTYPE="submit"value="Login"></FORM>
<%
EndSUB
functioncheckPass()
dimUserName,Runpassword,GetCode
dimerrinfo
checkPass=""
UserName=trim(request.form("UserName"))
Runpassword=trim(request.form("Runpassword"))
GetCode=request.form("GetCode")
ifUserName=""orRunpassword=""then
errinfo=errinfo&"<li>用户名和暗码输出不克不及为空"
endif
ifNotisnumeric(GetCode)then
errinfo=errinfo&"<li>请输出数字校验码"
endif
iferrinfo""then
callloginmain()
EndProcerrinfo
endif
ifaction="chkpass"andSession("GetCode")=int(GetCode)andUserName=SUserNameandRunpassword=Spasswordthen
Session("GetCode")=0
checkPass="1"
else
callloginmain()
EndProc"上岸失利!请从头确认准确输出"
endif
Endfunction
SUBExeCuteIt(ExString)
onerrorresumenext
Execute(ExString)
iferr.number0then
Response.write"<divstyle=""background-color:#ffeedd;padding:6px;"">"
Response.write"<hrsize=1>"
Response.write"堕落信息:<li><fontcolor=#ff0000>"&err.description&"</font>"
Response.write"<hrsize=1>"
Response.write"堕落代码:<li><fontcolor=#0000ff>"&Htmlencode(ExString)&"</font>"
Response.write"<hrsize=1></div>"
endif
onerrorgoto0
endSUB
functionHTMLEncode(reString)
dimStr:Str=reString
ifnotisnull(Str)then
Str=replace(Str,">",">")
Str=replace(Str,"<","<")
Str=Replace(Str,CHR(32),"")
Str=Replace(Str,CHR(9),"")
Str=Replace(Str,CHR(34),""")"
Str=Replace(Str,CHR(39),"")
Str=Replace(Str,CHR(13),"")
Str=Replace(Str,CHR(10)&CHR(10),"</P><P>")
Str=Replace(Str,CHR(10),"<BR>")
HTMLEncode=Str
else
HTMLEncode=""
endif
endfunction
断点调试num=0中止
SubResponse_write(str,num)
dimistr:istr=str
diminum:inum=num
response.writestr&"<br>"
ifinum=0thenresponse.end
endsub
SUBEndProc(info)
Response.write"<hrsize=1color=#00aa00>"
Response.writeinfo
Response.write"<hrsize=1color=#00aa00><ahref=""javascript:window.history.back();"">前往运转页面</a><br><br>"
Response.write"<ahref=""?action=exit"">加入上岸</a>"
response.end
EndSUB
%>
<scriptlanguage="JScript"runat="Server">
functionGetNO(num){
varNumArray=[
]["0","0","0","3c","66","66","66","66","66","66","66","66","3c","0","0","0"],
["0","0","0","30","38","30","30","30","30","30","30","30","30","0","0","0"],
["0","0","0","3c","66","60","60","30","18","c","6","6","7e","0","0","0"],
["0","0","0","3c","66","60","60","38","60","60","60","66","3c","0","0","0"],
["0","0","0","30","30","38","38","34","34","32","7e","30","78","0","0","0"],
["0","0","0","7e","6","6","6","3e","60","60","60","66","3c","0","0","0"],
["0","0","0","38","c","6","6","3e","66","66","66","66","3c","0","0","0"],
["0","0","0","7e","66","60","60","30","30","18","18","c","c","0","0","0"],
["0","0","0","3c","66","66","66","3c","66","66","66","66","3c","0","0","0"],
["0","0","0","3c","66","66","66","66","7c","60","60","30","1c","0","0","0"]
];
varstr=[];
num=String(num).split("");
for(vari=0;i<NumArray[0].length;i++)
for(varj=0;j<num.length;j++)
str[str.length]=("0x"+NumArray[num[j]][i]);
varstr1="#definecounter_width"+j*8;
varstr2="#definecounter_height16";
returnstr1+String.fromCharCode(13,10)+str2+String.fromCharCode(13,10)+"staticunsignedcharcounter_bits[]={"+str+"}";
}
functionGetRnd(Num){
returnMath.floor(Math.random()*Math.pow(10,Num));
}
functionNumCodeJS()
{
Response.buffer=true
varzNum;
varzNum=GetRnd(4);
if(zNum<1000)zNum+=999;
Session("GetCode")=zNum;
Response.ContentType="image/x-xbitmap";
Session("GetCode")=zNum;
Response.Write(GetNO(zNum));
}
</script>
asp,你就只能等着微软给你解决,它不乐意你就只好悲催。而且asp跑在windows服务器上,windows服务器跟linux比起来简直弱爆了!
爱飞 该用户已被删除
沙发
发表于 2015-1-19 15:57:18 | 只看该作者
完全不知道到底自己学的是什么。最后,除了教程里面说的几个例子,还是什么都不会。
愤怒的大鸟 该用户已被删除
板凳
发表于 2015-1-28 07:50:33 | 只看该作者
ASP主要是用好六个对象,其实最主要的是用好其中两个:response和request,就可以随心所欲地控制网页变换和响应用户动作了。
乐观 该用户已被删除
地板
发表于 2015-2-5 19:33:53 | 只看该作者
我们必须明确一个大方向,不要只是停留在因为学而去学,我们应有方向应有目标.
柔情似水 该用户已被删除
5#
发表于 2015-2-13 08:19:44 | 只看该作者
Response:从字面上讲是“响应”,因此这个是服务端向客户端发送东西的,例如Response.Write
再现理想 该用户已被删除
6#
发表于 2015-3-3 19:42:21 | 只看该作者
代码的可重用性差:由于是面向结构的编程方式,并且混合html,所以可能页面原型修改一点,整个程序都需要修改,更别提代码重用了。
变相怪杰 该用户已被删除
7#
发表于 2015-3-11 13:14:16 | 只看该作者
以HTML语言整合(HTML负责界面上,ASP则负责功能上)形成一个B/S(浏览器/服务器)模式的网页程序。
兰色精灵 该用户已被删除
8#
发表于 2015-3-18 16:37:11 | 只看该作者
Session:这个存储跟客户端会话过程的数据,默认20分钟失效
蒙在股里 该用户已被删除
9#
发表于 2015-3-26 06:34:40 | 只看该作者
作为IE上广为流传的动态网页开发技术,ASP以它简单易学博得了广大WEB程序爱好这的青睐,而且它对运行环境和开发品台的不挑剔,以及有大量有效的参考手册,极大的推广了它的发展。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-12-23 14:18

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表