|
<HTML><BODY>
<%
Function DisplayText( Target )
Dim FileSystem
Dim FileHandle
Dim SourcePath
Dim LineString
Err.Clear
Set FileSystem = Server.CreateObject( "Scripting.FileSystemObject" )
if Target = "" then
DisplayText = -1
Exit Function
end if
On Error Resume Next
SourcePath = Server.MapPath( Target )
if Err.Number <> 0 then
DisplayText = -2
Exit Function
end if
On Error Goto 0
if not FileSystem.FileExists( SourcePath ) then
DisplayText = -3
Exit Function
end if
Set FileHandle = FileSystem.OpenTextFile( SourcePath, 1 )
Response.Write "<PRE>" & vbCrLf
Do While FileHandle.AtEndOfStream <> True
LineString = Server.HTMLEncode( FileHandle.ReadLine )
Response.Write LineString & vbCrLf
Loop
Response.Write "</PRE>" & vbCrLf
FileHandle.Close
DisplayText = 0
End Function
ret = DisplayText( Request.ServerVariables( "SCRIPT_NAME" ) )
if ret <> 0 then
Response.Write ret & "<br>"
end if
%></BODY>
</HTML>
| |