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.
Re: Reading a textfile (in resources) into a textbox
Have you tried
TextBox1.Text = My.Resources.Name Of File
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;)
Re: Reading a textfile (in resources) into a textbox
Haha after trying all the complicated ideas the simplist works =D.
Thanks guys,
Regards.