vb Read and Write files
Sub ReadTextFile()
Dim FS,F,T,strData
Set FS = Server.CreateObject("Scripting.FileSystemObject")
Set T = FS.OpenTextFile(Server.MapPath("notes.txt"),1,false)
strData = T.ReadAll
T.Close
Response.Write(strData)
Set FS = Nothing
Set T = Nothing
End Sub
Sub SaveData(strFileName,strData)
Dim FS,F
Set FS = Server.CreateObject("Scripting.FileSystemObject")
Set F = FS.CreateTextFile(Server.MapPath(strFileName),true)
F.Write(strData)
F.Close
Set F = Nothing
Set FS = Nothing
End SubReads data from a text file and writes data to it.
Updated: Saturday 9th October 2010, 06:04pm
There are 0 comments
Comments are currently closed.