让使用者可以看到你的ASP的原代码 |
| 作者:佚名 来源:不详 更新:2006-8-25 21:05:35 错误报告 我要投稿 |
假如你写了一个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
%>
|
|
| 文章录入:skyuu 责任编辑:skyuu |
|
| 【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |