假如你写了一个asp的程序,希望让你的使用者看到asp的原始代码,你可以利用filesystemobject这个对象送出程序原始代码.<%@ language=vbscript%>
<%option explicit%>
<%
dim strurl
strurl = request.querystring("url")
dim strdir, strfilename
strdir = request.servervariables("appl_physical_path")
response.write strdir
strfilename = replace(strurl,"/","\")
strfilename = strdir & strfilename
const forreading = 1
dim objfso, objtextstream
set objfso = server.createobject("scripting.filesystemobject")
set objtextstream = objfso.opentextfile(strfilename, forreading)
response.write "<html><body>"
response.write "<xmp>" & objtextstream.readall & "</xmp>"
response.write "</body></html>"
objtextstream.close
set objtextstream = nothing
set objfso = nothing
%>