当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP > ASP Line 属性

ASP
ASP Drive
ASP File
ASP Folder
ASP Dictionary
ASP ADO
ASP AdRotator
ASP BrowserCap
ASP Content Linking
ASP Content Rotator
ASP Quick Ref
ASP 摘要
ASP 实例

ASP Line 属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 336 ::
收藏到网摘: n/a

The Line property returns the current line number in a TextStream file (starting at 1).
Line属性返回所处文本的行数(从第一行开始计数)。

Syntax
语法

TextStreamObject.Line

Example
举例

<%
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!
Line 2: How are you today?
Line 3: Goodbye!


评论 (0) All

登陆 | 还没注册?