zingbats Posted August 11, 2003 Posted August 11, 2003 I have just bought VB.NET and I think that is very well constructed and well designed. I am making a PHP editor (like a text editor) to start off making simple programs. I can save files, edit files, but, when I open the text file into the main box, it only opens the first line of text within the file. I tried the rich text thingy but that creates boxes as line breaks which aren't readable by notepad. It needs to be readable by notepad!. I stopped it printing with line break "boxes" by changing the box type to multiline text boxt. Here is my code. OpenDialog1.ShowDialog() FileOpen(1, OpenDialog1.FileName, OpenMode.input) Input(1, TextBox1.Text) FileClose(1) Are there any settings I need to change? Kind regards; Alex Quote
*Experts* mutant Posted August 11, 2003 *Experts* Posted August 11, 2003 First, dont use the old VB6 way of reading files, its slower then the new StreamReaders :). This will do it, using a StreamReader: OpenDialog1.ShowDialog() Dim reader as new IO.StreamReader(OpenDialog1.FileName) 'new stream reader object with the file name from the dialog TextBox1.Text = reader.ReadtoEnd() 'read the whole thing using 'ReadToEnd() method reader.Close() 'close the strea, :) Quote
zingbats Posted August 11, 2003 Author Posted August 11, 2003 U learn summit everyday. I would like to say that I am very impressed with the standard of this forum and the speed at which my query was answered. =) I hope one day I will be here helping people as well :p Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.