Results 1 to 2 of 2

Thread: how to import different lines of text from a text file

  1. #1

    Thread Starter
    Banned
    Join Date
    Jan 2009
    Posts
    138

    how to import different lines of text from a text file

    how to import different lines of text from a text file in the same directory to different textboxes Please Help!

    e.g. line one in text file to textbox1.text ect.

  2. #2
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Re: how to import different lines of text from a text file

    Code:
    Dim l() As String = IO.File.ReadAllLines("the text file")
    For i As Integer = 0 To l.Length - 1
         Me.Controls("TextBox" & (i + 1).ToString()).Text = l(i)
    Next

Tags for this Thread

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