Hi,
I may be completely stupid but I can't make the code below work?! The text file TEST.TXT is a one liner (attached) and it is still not working!!!!! Please can somebody help me...... this was copied straight from MSDN...
I receive the error as follows:Code:using (StreamReader sr = new StreamReader("c:\\TEST.TXT")) { String line; while ((line = sr.ReadLine()) != null) { tb.AppendText(line + Environment.NewLine); } }
Does anybody know what I am doing wrong?Index and Length must refer to a location within the string.
Thanks in advance,
DJ




Reply With Quote