Display content of ASP file (any file for that matters)
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
' 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>"
Response.Write "<h1><Center>" & ViewSource(File) & "</Center></h1>"
Views 4,751
Downloads 1,427
CodeID
DB ID
ANmarAmdeen
610
Revisions
v1.0
Wednesday
July
11
2018