![]() |
|
||||||||||||||
| | 网站首页 | 软件下载 | 技术文章 | 博瑞商城 | 贵客留言 | | ||
|
||
|
|||||
| 一段用ASP查看ASP文件源码的程序. | |||||
作者:佚名 文章来源:网上收集 点击数: 更新时间:2008-6-23 ![]() |
|||||
|
SUB PrintLine (ByVal strLine) strLine=server.HTMLEncode(strLine) strLine=replace(strLine,"<%","<FONT COLOR=#ff0000><%") strLine=replace(strLine,"%>","%></FONT>") strLine=replace(strLine,"<SCRIPT","<FONT COLOR=#0000ff><SCRIPT",1,-1,1) strLine=replace(strLine,"</SCRIPT>","</SCRIPT></FONT>",1,-1,1) strLine=replace(strLine,"<!--","<FONT COLOR=#008000><!--",1,-1,1) strLine=replace(strLine,"-->","--></FONT>",1,-1,1) Response.Write strLine END SUB Function ShowCode(filename) Dim strFilename Dim FileObject, oInStream, strOutput strFilename = filename Set FileObject = Server.CreateObject("Scripting.FileSystemObject") Set oInStream = FileObject.OpenTextFile(strFilename, 1, 0, 0 ) While NOT oInStream.AtEndOfStream strOutput = oInStream.ReadLine Call PrintLine(strOutput) Response.Write("<BR>") Wend end function %> <HTML> <HEAD> <TITLE>ASP源码浏览器</TITLE> </HEAD> <BODY BGCOLOR=#FFFFFF> <form action=viewcode.ASP method=post> 请输入ASP文件名 <input type=file name=filename> <input type=submit value="查看源程序"> </form> <% on error resume next dim file file=request.form("filename") response.write file & "源程序如下<hr>" if trim(file)<> "" then call showcode(file) end if %> </FONT> </BODY> </HTML> |
|||||
| 文章录入:admin 责任编辑:admin | |||||
| 【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 | |||||
| 最新热点 | 最新推荐 | 相关文章 | ||
| 没有相关文章 |
| 网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!) |
| | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 网站公告 | 管理登录 | | |||
|