ASP AtEndOfStream property
If the file pointer is at the end of the TextStream file, AtEndOfStream property returns True, otherwise False.
Note: This property only works in read-only open TextStream object.
grammar
TextStreamObject.AtEndOfStream
Examples
<%
dim fs,f,t,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.CreateTextFile("c:\test.txt")
f.write("Hello World!")
f.close
set t=fs.OpenTextFile("c:\test.txt",1,false)
do while t.AtEndOfStream<>true
x=t.Read(1)
loop
t.close
Response.Write("The last character is: " & x)
%>
输出:
The last character in the text file is: !
dim fs,f,t,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.CreateTextFile("c:\test.txt")
f.write("Hello World!")
f.close
set t=fs.OpenTextFile("c:\test.txt",1,false)
do while t.AtEndOfStream<>true
x=t.Read(1)
loop
t.close
Response.Write("The last character is: " & x)
%>
输出:
The last character in the text file is: !
Complete TextStream Object Reference