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

ASP
ASP 介绍
ASP Install
ASP 语法
ASP 变量
ASP Procedures
ASP Forms
ASP Cookies
ASP Session
ASP Application
ASP #include
ASP Global.asa
ASP Send e-mail
ASP Response
ASP Request
ASP Application
ASP Session
ASP Server
ASP Error
ASP FileSystem
ASP TextStream

ASP Line 属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 335 ::
收藏到网摘: 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

登陆 | 还没注册?