<%
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>
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器