..


Sponsored Links

Line

The properties of the Line 'TextStream returns the number of the current line in a file TextStream.

Let's take an example.
Suppose you have a text file (c: \ test.txt) with the following contents:

 



 Hello what's your name?







 My name is Marcello!







 Nice to meet you!

 
This is the code





 dim fs, t









 'I create an instance of the FSO







 Set fs = Server.CreateObject ("Scripting.FileSystemObject")

 







 'I open the file in read mode







 Set T = fs.OpenTextFile ("c: \ test.txt", 1)









 'Loop the file







 = false do while t.AtEndOfStream



  



 loop









 'Close







 t.Close







 Set T = Nothing







 Set fs = Nothing



the output will be generated:
 



 Line 1: Hello what's your name?







 Line 2: My name is Marcello!







 Line 3: Nice to meet you!

 

In the same category ...
E-Learning
ASP (Advanced) ASP (Advanced)
Full course for creating dynamic Web sites. From 39 €.
ASP Zero (Ebook) ASP Zero (Ebook)
Learning Microsoft ASP and VBScript from scratch. At only 29 €.
ASP and Access (Ebook) ASP and Access (Ebook)
Managing a MS Access database with ASP. At only 29 €.
Sponsored Links