J
JB
I'm trying to read a text file, and store the position of a specified
line, and then later seek back to that line and start reading again.
I'm using simple code like the following:
StreaReader sr = new StreamReader("test.txt");
String s = "";
while (S != null)
{
S = sr.ReadLine()
//process line
}
sr.BaseStream.Position always returns the same value (1024) so isn't
much use in this regard.
I can track the line position manually, but then i cant Seek back to
the start of said line.
Or Can I?
Cheers guys,
line, and then later seek back to that line and start reading again.
I'm using simple code like the following:
StreaReader sr = new StreamReader("test.txt");
String s = "";
while (S != null)
{
S = sr.ReadLine()
//process line
}
sr.BaseStream.Position always returns the same value (1024) so isn't
much use in this regard.
I can track the line position manually, but then i cant Seek back to
the start of said line.
Or Can I?
Cheers guys,