Results 1 to 3 of 3

Thread: [VB 2005] Streamreader Help

  1. #1

    Thread Starter
    Hyperactive Member knxrb's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    321

    Exclamation [VB 2005] Streamreader Help

    I need some code that will read a textfile line by line and show the lines in labels.

    Example:
    label1.text = line 1
    label2.text = line 2

    Please help. I am using Visual Studio 2005 - VB
    -----
    knxrb

  2. #2
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: [VB 2005] Streamreader Help

    Code:
    Dim lines() As String = System.IO.File.ReadAllLines("put the path to your text file here")
    Label1.Text = lines(0)
    Label2.Text = lines(1)
    ' Keep going until you get all the labels

  3. #3

    Thread Starter
    Hyperactive Member knxrb's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    321

    Re: [VB 2005] Streamreader Help

    Thanks!!!!!!!!!!!!!!!!!!!!!!

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