最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
一段用ASP查看ASP文件源码的程序.
时间:2008-01-18 编辑:简简单单 来源:一聚教程网
SUB PrintLine (ByVal strLine)
strLine=server.HTMLEncode(strLine)
strLine=replace(strLine,"<%","<%")
strLine=replace(strLine,"%>","%>")
strLine=replace(strLine,"<SCRIPT","<SCRIPT",1,-1,1)
strLine=replace(strLine,"</SCRIPT>","</SCRIPT>",1,-1,1)
strLine=replace(strLine,"<!--","<!--",1,-1,1)
strLine=replace(strLine,"-->","-->",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("
")
Wend
end function
%>
<%
on error resume next
dim file
file=request.form("filename")
response.write file & "源程序如下
"
if trim(file)<> "" then
call showcode(file)
end if
%>
-
上一个: 链接提示文字的实现
-
下一个: ADSI,使用ASP来完成NT管理
相关文章
- 把asp程序封装成可执行文件(无需IIS web服务器)直接运行的管理系统 01-12
- VBS 批量Ping的项目讲解 09-19
- 如何封装一个Ajax函数介绍 09-16
- ASP实现加法验证码方法 09-16
- ASP错误捕获的几种常规处理方法介绍 09-16
- ajax实现城市三级联动的代码介绍 09-16