ASP WriteLine Method

Definition and Usage

The WriteLine method writes a specified text and a new line character to the TextStream file.

Syntax:

TextStreamObject.WriteLine(text)
Parameter Description
text Optional. The text that needs to be written to the file. If you do not specify this parameter, a new line character will be written to the file.

Instance

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject") 
set f=fs.CreateTextFile("c:\test.txt",true)
f.WriteLine("Hello World!")
f.WriteLine("How are you today?")
f.WriteLine("Goodbye!")
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?
Goodbye!