ViewSource

Display content of ASP file (any file for that matters)

CodeFunctionName
What is this?

Public

Tested

Imported
Function ViewSource(ASPFile)
' option explicit
Const ForReading = 1
Dim Ts,i
Rett = ""
' Set Fso = Server.CreateObject("Scripting.FileSystemObject")
Set Ts = Fso.OpenTextFile( Server.MapPath(ASPFile), ForReading)
While Not Ts.AtEndOfStream
i=i+1
Rett = Rett & " <b >" & i & ". </b >" & Server.htmlencode(Ts.readline) & " <br / >"
Wend
Set Ts = Nothing
ViewSource = Rett
End Function

ASPFile

File = Request.QueryString("file")
Response.Write "<h1><Center>" & ViewSource(File) & "</Center></h1>"

Views 4,751

Downloads 1,427

CodeID
DB ID