G
Guest
Hi there,
I am reading in a textfile which looks like this (there is no new line after
the last number)
03 98661881
0407 566453
The code to load the textfile looks like this:
System.IO.Stream sio;
sio = fDocument.PostedFile.InputStream;
StreamReader sr = new StreamReader(sio);
string line;
while ((line = sr.ReadLine()) != null)
{
dcd.AddTechPhone(TextBoxNumber.Text ,line);
}
The problem is that it adds a blank line to the last record in the textfile.
How can I avoid it?
Thanks
Chris
I am reading in a textfile which looks like this (there is no new line after
the last number)
03 98661881
0407 566453
The code to load the textfile looks like this:
System.IO.Stream sio;
sio = fDocument.PostedFile.InputStream;
StreamReader sr = new StreamReader(sio);
string line;
while ((line = sr.ReadLine()) != null)
{
dcd.AddTechPhone(TextBoxNumber.Text ,line);
}
The problem is that it adds a blank line to the last record in the textfile.
How can I avoid it?
Thanks
Chris