ASP AtEndOfLine 屬性

AtEndOfLine 屬性返回一個布爾值。True 指示檔指針緊靠 TextStream 檔中行末標記之前,否則返回 False。
注意:該屬性僅工作於以只讀方式打開的 TextStream 對象。
語法
TextStreamObject.AtEndOfLine
實例
<%
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.AtEndOfLine<>true
x=t.Read(1)
loop
t.close
Response.Write("The last character is: " & x)
%>
輸出:
The last character of the first line 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.AtEndOfLine<>true
x=t.Read(1)
loop
t.close
Response.Write("The last character is: " & x)
%>
輸出:
The last character of the first line in the text file is: !
