I have listed my code and also the ouput. Output tells me "file was written" when I go to c: drive I do not see this file created.
Pls Help. Thank you!
<% @ LANGUAGE = VBScript %>
<% Option Explicit %>
<%
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristatUseDefault = -2 ' Opens the file using the system default
Const TristateTrue = -1 'Opens the file as Unicode
Const TristateFalse = 0 'Opens the file as ASCII
Dim ObjFS, objTextS, strLine
Set objFS=Server.CreateObject ("Scripting.FileSystemObject")
If objFS.FileExists("c:\Max.txt") = True Then
Set objTextS = objFS.OpenTextFile("c:\Max.txt", ForAppending, False, TristateFalse)
Else
Set objTextS = objFS.CreateTextFile("c:\Max.txt", False, False)
End if
objTextS.WriteLine "This was written at " & Now & "."
objTextS.Close
Set objTextS = objFS.OpenTextFile("c:\Max.txt", ForReading,TristateFalse)
Response.Write "The Content of the File: <br><br>" & VbCrlf
Do While objTextS.AtEndOfStream <> True
strLine = objTextS.ReadLine
strLine = Server.HTMLEncode(strLine)
Response.Write strLine & "<Br>" & VbCrlf
Loop
objTextS.Close
Set objTextS = Nothing
Set objFS = Nothing
%>
_______________________________________
output from LocalHost------
The Content of the File:
This was written at 7/29/2004 10:07:54 AM.