ASP Line 屬性
完整的 TextStream 對(duì)象參考手冊(cè)
Line 屬性返回在 TextStream 文件中的當(dāng)前行號(hào)(從 1 開始)。
語法
實(shí)例
<%
dim fs,f,t
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 t=fs.OpenTextFile("c:\test.txt",1)
do while t.AtEndOfStream=false
??Response.Write("Line " & t.Line & ": ")
??Response.Write(t.ReadLine)
??Response.Write("<br>")
loop
t.Close
%>
輸出:
Line 1: Hello World!
Line 2: How are you today?
Line 3: Goodbye!
完整的 TextStream 對(duì)象參考手冊(cè)
更多建議: