VBScript » TextStream » ReadLine

Version: 2.0

Syntax:
object.ReadLine

Reads a single line (excluding the newline character) from a TextStream file and returns the contents as a string.

Reads a single line (excluding the newline character) from a TextStream file and returns the contents as a string.

Examples

Code:
<%
dim filesys, text, readfile, contents
set filesys = CreateObject("Scripting.FileSystemObject")
Set text = filesys.CreateTextFile("c:\somefile2.txt")
text.Write "A quick example of the ReadLine method"
text.close
set readfile = filesys.OpenTextFile("c:\somefile2.txt", 1, false)
contents = readfile.ReadLine
readfile.close
Response.Write "The line contains the following text - '" contents "'."
%>
Output:
"The line contains the following text - 'A quick example of the ReadLine method'.