上一篇 | 下一篇

一段用ASP查看ASP文件源码的程序

发布: 2008-6-27 11:50 | 作者: admin | 来源: | 查看: 1次

<%

SUB PrintLine (ByVal strLine)

strLine=server.HTMLEncode(strLine)

strLine=replace(strLine,"<%","<%")

strLine=replace(strLine,"%>","%>")

strLine=replace(strLine,"

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

%>

ASP源码浏览器

请输入ASP文件名

<%

on error resume next

dim file

file=request.form("filename")

response.write file & "源程序如下


"

if trim(file)<> "" then

call showcode(file)

end if

%>

字号: | 推荐给好友

评分:0

我来说两句