仓酷云

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

[学习教程] ASP网站制作之检察ASP源代码的办法

[复制链接]
爱飞 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-16 23:34:43 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

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

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

x
当然了,现在国内CRM厂商的产品与其说是CRM,但从至少从我的角度分析上来看,充其量只是一个大型的进销存而已了,了解尚浅,不够胆详评,这里只提技术问题源代码我们都晓得asp这一类的服务器端处置的程序,其优点之一就是只向客户端输入
尺度的Html流。因而能够起到向客户埋没细节的感化。也就是说当我们在扫瞄器中
键进asp程序的网址后只能瞥见尺度的Html文件,而不克不及瞥见asp的内容。但偶然,
比方在一个asp的教授教养站点,我们有需要显现asp文件的内容,大概你乐意将你的原
代码与人享,经由过程一个程序将代码显现出来。
上面是我编写的一个asp程序,view_code.asp,它供应两种提交体例:一种是用
表格提交,即你晓得了该源文件的物理地点(相似于:c:asp_source        est.asp的
情势)。一种是接纳get体例提交(相似于:<ahref="view_code.asp?code_path=
<%=server.mappath(request.servervariables("PATH_INFO"))%>&cgi_type=asp">
点击此处检察原代码</a>)。别的它还撑持两种cgi剧本,一种是asp,一种是php。

代码段:
<%
onerrorresumenext
疏忽程序实行中的毛病,在程序的最初一致处置。
%>
<%
functionrt_min(num1,num2)
该子程序用于前往两数中不即是零的最小数。
ifnum1=0andnum2=0then
rt_min=-1
elseifnum1=0then
rt_min=num2
elseifnum2=0then
rt_min=num1
elseifnum1<num2then
rt_min=num1
else
rt_min=num2
endif
endfunction
%>
<%
functionline_check(strline,cgi_type)
该子程序用于反省输出段中是不是包括有"<%、%>、<script或</script的特别字符
dimcgi_flag
ifcgi_type="php"then
cgi_flag="?"
else
cgi_flag="%"
endif
界说的cgi_flag用于代表php和asp的分歧标识符
line_check=0
itemp=0
ipos=instr(strline,"<"&cgi_flag)
ifrt_min(ipos,itemp)=iposthen
itemp=ipos
line_check=1
endif
ipos=instr(strline,cgi_flag&">")
ifrt_min(ipos,itemp)=iposthen
itemp=ipos
line_check=2
endif
ipos=instr(1,strline,"<"&"script",1)
ifrt_min(ipos,itemp)=iposthen
itemp=ipos
line_check=3
endif
ipos=instr(1,strline,"<"&"/script",1)
ifrt_min(ipos,itemp)=iposthen
itemp=ipos
line_check=4
endif
endfunction
%>
<%
subprinthtml(strline)
该子历程用于打印不含有上述四种特别标志的行
ispace=len(strline)-len(ltrim(strline))
i=1
while(mid(strline,i,1))=chr(9)
ispace=ispace+5
i=i+1
wend
统计空缺的数目
ifispace>0then
fori=1toispace
response.write("")
next
endif
ipos=instr(strline,"<")
ifiposthen
response.write(left(strline,ipos-1))
response.write("<")
用<来替换<,使扫瞄器不注释中的标志
strline=right(strline,len(strline)-ipos)
callprinthtml(strline)
自挪用,直到没有<的呈现
else
response.write(strline)
endif
endsub
%>
<%
subprintline(strline,iflag,cgi_type)
该自历程用于依据line_check的前往值分离处置
dimcgi_flag
ifcgi_type="php"then
cgi_flag="?"
else
cgi_flag="%"
endif
selectcaseiflag
case0
callprinthtml(strline)
case1
ipos=instr(strline,"<"&cgi_flag)
callprinthtml(left(strline,ipos-1))
response.write("<fontcolor=#ff0000>")
response.write("<"&cgi_flag)
strline=right(strline,len(strline)-ipos-1)
callprintline(strline,line_check(strline,cgi_type),cgi_type)
自挪用,直到没有四种特别标志的呈现
case2
ipos=instr(strline,cgi_flag&">")
callprinthtml(left(strline,ipos-1))
response.write(cgi_flag&">")
response.write("</font>")
strline=right(strline,len(strline)-ipos-1)
callprintline(strline,line_check(strline,cgi_type),cgi_type)
case3
ipos=instr(1,strline,"<"&"script",1)
callprinthtml(left(strline,ipos-1))
response.write("<fontcolor=#00ff00>")
response.write("<"&"script")
strline=right(strline,len(strline)-ipos-6)
callprintline(strline,line_check(strline.cgi_type),cgi_type)
case4
ipos=instr(1,strline,"<"&"/script>",1)
callprinthtml(left(strline,ipos-1))
response.write("lt;"&"/script"&">")
response.write("</font>")
strline=right(strline,len(strline)-ipos-8)
callprintline(strline,line_check(strline,cgi_type),cgi_type)
caseelse
response.write("error")
endselect
endsub
%>
<html>
<head>
<title>viewcgi_code(.aspor.php)</title>
</head>
<body>
<formaction="view_code.asp"method="POST">
请输出路径:<inputtype=textname="code_path">
请选择范例:<selectname="cgi_type&qu</p>Windows本身的所有问题都会一成不变的也累加到了它的身上。安全性、稳定性、跨平台性都会因为与NT的捆绑而显现出来;
莫相离 该用户已被删除
11#
发表于 2015-3-22 17:10:56 | 只看该作者
ASP也是这几种脚本语言中最简单易学的开发语言。但ASP也是这几种语言中唯一的一个不能很好支持跨平台的语言。  因为ASP脚本语言非常简单,因此其代码也简单易懂,结合HTML代码,可快速地完成网站的应用程序。
分手快乐 该用户已被删除
10#
发表于 2015-3-15 22:27:56 | 只看该作者
Session:这个存储跟客户端会话过程的数据,默认20分钟失效
柔情似水 该用户已被删除
9#
发表于 2015-3-8 12:02:23 | 只看该作者
我们必须明确一个大方向,不要只是停留在因为学而去学,我们应有方向应有目标.
乐观 该用户已被删除
8#
发表于 2015-2-26 04:37:22 | 只看该作者
另外因为asp需要使用组件,所以了解一点组件的知识(ADODB也是组件)
金色的骷髅 该用户已被删除
7#
发表于 2015-2-8 20:23:42 | 只看该作者
虽然ASP也有很多网络教程。但是这些都不系统。都是半路出家,只是从一个例子告诉你怎么用。不会深入讨论,更不会将没有出现在例子里的方法都一一列举出来。
只想知道 该用户已被删除
6#
发表于 2015-2-3 11:22:58 | 只看该作者
我可以结合自己的经验大致给你说一说,希望对你有所帮助,少走些弯路。
透明 该用户已被删除
5#
发表于 2015-1-29 20:31:56 | 只看该作者
Session:这个存储跟客户端会话过程的数据,默认20分钟失效
再见西城 该用户已被删除
地板
发表于 2015-1-29 14:47:47 | 只看该作者
ASP.Net摆脱了以前ASP使用脚本语言来编程的缺点,理论上可以使用任何编程语言包括C++,VB,JS等等,当然,最合适的编程语言还是MS为.NetFrmaework专门推出的C(读csharp),它可以看作是VC和Java的混合体吧。
若天明 该用户已被删除
板凳
发表于 2015-1-24 21:59:22 | 只看该作者
运用经典的例子。并且自己可以用他来实现一些简单的系统。如果可以对他进行进一步的修改,找出你觉得可以提高性能的地方,加上自己的设计,那就更上一个层次了,也就会真正地感到有所收获。
简单生活 该用户已被删除
沙发
发表于 2015-1-20 09:59:23 | 只看该作者
Server:这个表示的服务器,操作服务器的一些东西使用这个,如Server.Mappath转换服务器路径,Server.CreateObject实例化一个组件
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-9-21 13:38

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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