ASP Textstream.Line Property
The ASP Textstream.Line Property is a read-only property that can be used to return a current line number in a TextsStream File.
Syntax:
TextStreamObject.Line
Example: Below code returns the current line number:
ASP
<% dim gfg,f,t set gfg=Server.CreateObject( "Scripting.FileSystemObject" ) set f=gfg.CreateTextFile( "d:\GFG.txt" ,true) f.WriteLine( "Hello GeeksForGeeks!" ) f.WriteLine( "A computer science portal for Geeks" ) f.WriteLine( "GFG is a Good platform tode!" ) f.close Set t=gfg.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 GeeksForGeeks! Line 2: A computer science portal for geeks! Line 3: GFG is a Good Platform to code!
Please Login to comment...