| |
Thinker302002
Posts: 1
Score: 0
Joined: 7/7/2004
From:
Status: offline
|
Read: Dim objFSO , objFile Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile(Server.MapPath("testfile.txt") , 1) Response.Write (objFile.ReadAll) objFile.Close Set objFSO = Nothing Set objFile = Nothing Write: Option Explicit ' Set up Constants Const ForWriting = 2 ' Input OutPut mode Const Create = True Dim MyFile Dim FSO ' FileSystemObject Dim TSO ' TextStreamObject ' Use MapPath function to get the Physical Path of file MyFile = Server.MapPath("textfile.txt") Set FSO = Server.CreateObject("Scripting.FileSystemObject") Set TSO = FSO.OpenTextFile(MyFile, ForWriting, Create) TSO.write "This is first line in this text File" & vbcrlf ' Vbcrlf is next line character TSO.write "This is Second line in this text file" & vbcrlf TSO.write "Writen by devasp visitor at " & Now() TSO.WriteLine "" Response.Write " Three lines are writen to textfile.txt <br>" Response.Write " Local time at server is " & Now() ' close TextStreamObject and ' destroy local variables to relase memory TSO.close Set TSO = Nothing Set FSO = Nothing the rest you should be able to handle...
|
|