AtEndOfStream
ASP AtEndOfStream 属性
如果文件指针位于 TextStream 文件的末尾,AtEndOfStream 属性返回 True,否则返回 False。
注意:该属性仅工作于以只读方式打开的 TextStream 对象。
语法
TextStreamObject.AtEndOfStream
实例
<%
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: !