Hello all,
I have a simple loop built to read lines out of a text file...I have no way of testing if I've reached the end of hte file however. Here is the code:
StreamReader stream = new StreamReader(filename, true);
currentLine = stream.ReadLine(); // Get first line (headers)
headers = currentLine.Split('\t');
while (true)
{
currentLine = stream.ReadLine();
MessageBox.Show(currentLine);
values = currentLine.Split('\t');
}
doing it this way simply crashed out at the 'values = ' statement.
I didn't see any other methods to test for the end.
Any thoughts?
Many thanks!
Sam
I have a simple loop built to read lines out of a text file...I have no way of testing if I've reached the end of hte file however. Here is the code:
StreamReader stream = new StreamReader(filename, true);
currentLine = stream.ReadLine(); // Get first line (headers)
headers = currentLine.Split('\t');
while (true)
{
currentLine = stream.ReadLine();
MessageBox.Show(currentLine);
values = currentLine.Split('\t');
}
doing it this way simply crashed out at the 'values = ' statement.
I didn't see any other methods to test for the end.
Any thoughts?
Many thanks!
Sam