当前位置: 首页 >> 程序设计 >> 一段用ASP查看ASP文件源码的程序
 

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

作者:      来源:     发表时间:2006-06-14     浏览次数:      字号:    

中国源码网内相关主题链接
  • 一段用ASP查看ASP文件源码的程序
  • <%
    SUB PrintLine (ByVal strLine)
    strLine=server.HTMLEncode(strLine)
    strLine=replace(strLine,"&lt;%","<FONT COLOR=#ff0000>&lt;%")
    strLine=replace(strLine,"%&gt;","%&gt;</FONT>")
    strLine=replace(strLine,"&lt;SCRIPT","<FONT COLOR=#0000ff>&lt;SCRIPT",1,-1,1)
    strLine=replace(strLine,"&lt;/SCRIPT&gt;","&lt;/SCRIPT&gt;</FONT>",1,-1,1)
    strLine=replace(strLine,"&lt;!--","<FONT COLOR=#008000>&lt;!--",1,-1,1)
    strLine=replace(strLine,"--&gt;","--&gt;</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>

    来源: http://www.dwww.cn/new/2006527192262030.html

    编辑 webmaster

     
     
     
    评论更多>>
     
     
    发表
     
    姓名: QQ:
    性别: MSN:
    E-mail: 主页:
    评分: 1 2 3 4 5
    评论内容:
    验证码:
      
  • 请遵守《互联网电子公告服务管理规定》及中华人民共和国其他各项有关法律法规。
  • 严禁发表危害国家安全、损害国家利益、破坏民族团结、破坏国家宗教政策、破坏社会稳定、侮辱、诽谤、教唆、淫秽等内容的评论 。
  • 用户需对自己在使用本站服务过程中的行为承担法律责任(直接或间接导致的)。
  • 本站管理员有权保留或删除评论内容。
  • 评论内容只代表网友个人观点,与本网站立场无关。
  •