Displaying Source Code(s)
|
|
Read Text
--------------------------------------------------------------------------------
Description : Opens a textfile and shows contents
<html>
<head>
</head>
<body>
<%
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Dim objTextStream
Const strFileName = "d:websitesjeffasmithcom
ead_text est.txt"
Const fsoForReading = 1
If objFSO.FileExists("d:websitesjeffasmithcom
ead_text est.txt") Then
'The file exists, so open it and output its contents
Set objTextStream = objFSO.OpenTextFile(strFileName,
fsoForReading)
Response.Write "<PRE>" & objTextStream.ReadAll & "</PRE>"
objTextStream.Close
Set objTextStream = Nothing
Else
'The file did not exist
Response.Write strFileName & " was not found."
End If
'Clean up
Set objFSO = Nothing
%>
</body>
</html>
--------------------------------------------------------------------------------
|
|
|