Results 1 to 4 of 4

Thread: How to read text file line by line?

Threaded View

  1. #3
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,423

    Re: How to read text file line by line?

    try this:

    vb Code:
    1. dim lblCounter as integer = 1
    2.  
    3. Do while srFileReader.peek <> -1
    4.     'this will ouput text to label1, label2...etc
    5.     me.controls("Label" & lblCounter.tostring).text = sInputLine
    6.     lblCounter += 1
    7.     System.Console.WriteLine(sInputLine)
    8.     sInputLine = srFileReader.ReadLine()
    9.  
    10. Loop
    Last edited by .paul.; Sep 19th, 2010 at 06:35 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width