Results 1 to 4 of 4

Thread: Reading a textfile (in resources) into a textbox

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2009
    Posts
    16

    Reading a textfile (in resources) into a textbox

    Hello,

    How would i read a textfile that is in My.Resources and put the whole document in a textbox for the user to see?

    I figured i would need a IO.StreamReader and a IO.StringReader but cant figure out too much what to do with these.

    I figured i could create a loop until it has read to the end of the document but there is no check called HasLineAvailable or something.

    Regards.

  2. #2
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    499

    Re: Reading a textfile (in resources) into a textbox

    Have you tried

    TextBox1.Text = My.Resources.Name Of File

  3. #3
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Reading a textfile (in resources) into a textbox

    A StreamReader is used to read text data from a stream, so thats nothing you would use in this case.
    The StringReader class works very similar to the StreamReader, only that it works in strings instead of streams. From what I understand you dont need to perform any such operations on the string, but just display it in a TextBox. The post above holds the key
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Mar 2009
    Posts
    16

    Re: Reading a textfile (in resources) into a textbox

    Haha after trying all the complicated ideas the simplist works =D.

    Thanks guys,

    Regards.

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