If you are saying that, as you are reading the data, each line has some of
form of relationship to the following line that needs to be taken into
account while processing the original line then you you need to change your
construct to something like this:
string str1 = sr.ReadLine();
while (str1 != null)
{
// do some magic with the line
// read the following line
str2 = sr.ReadLine()
// break if it wasn't there cos our rule has been broken
if (str2 == null)
break;
// do some magic with the following line
// simulate a ReadLine to make sure the next iteration is using the
right values
str1 = str2;
}
"PointMan" <so**********@gmail.comwrote in message
news:e3**************@TK2MSFTNGP06.phx.gbl...
data is like below
1111
2222
3333
4444
5555
while((str1 = sr.ReadLine()) != null)
{
str2 = sr.ReadLine()
}
in this case
str1 read 1111 and then
str2 read 2222 and then
str1 read 3333.......
but i wanna read 2222 to str1 again.
is there any way to solve this?