当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP > ASP Line 属性
The Line property returns the current line number in a TextStream file (starting at 1).
Line属性返回所处文本的行数(从第一行开始计数)。
TextStreamObject.Line |
<% 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 %> Output: Line 1: Hello World! |