Wednesday, February 16, 2011

what is ASP TextStream?

The TextStream object is used to access the contents of text files.
The following code creates a text file (c:\test.txt) and then writes some text to the file (the variable f is an instance of the TextStream object):

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.CreateTextFile("c:\test.txt",true)
f.WriteLine("Hello World!")
f.Close
set f=nothing
set fs=nothing
%>
source w3schools.com