Właściwości wiersza ASP
![TextStream Object Reference](/images/up.gif)
Obiekt Linia zwraca plik TextStream w bieżącym numerem linii (zaczynając od 1).
gramatyka
TextStreamObject.Line
Przykłady
<%
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!
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 Object Reference](/images/up.gif)