ASP Write Method

Definition and Usage

The Write method writes the specified text to the TextStream file.

Note:This method writes text to the TextStream file without spaces or line breaks between each string.

Syntax

TextStreamObject.Write(text)
Parameter Description
text Required. The text to be written to the file.

Instance

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject") 
set f=fs.CreateTextFile("c:\test.txt",true)
f.write("Hello World!")
f.write("How are you today?")
f.close
set f=nothing
set fs=nothing
%>

After executing the above code, the file test.txt is as follows:

Hello World! How are you today?