首 页新闻文章中心下载中心客户留言
您当前的位置:古朴下载网文章中心网页设计 → 文章内容 退出登录 用户管理
本类热门文章
相关下载
一段用ASP查看ASP文件源码的程序
作者:佚名  来源:不详  发布时间:2008-3-4 14:44:40

减小字体 增大字体

<%
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>


[] [返回上一页] [打 印]
文章评论 (评论内容只代表网友观点,与本站立场无关!)

用户名: 查看更多评论

分 值:100分 85分 70分 55分 40分 25分 10分 0分

内 容:

         (注“”为必填内容。) 验证码: 验证码,看不清楚?请点击刷新验证码

关于本站 - 网站帮助 - 广告合作 - 下载声明 - 友情连接 - 网站地图 - 管理登陆
友情连接及广告业务QQ:104261325(请注明来意)本网站日IP超五千,欢迎各位做广告及进行连接