N
nevin
(having a nightmare with my news client(s) so apologies if this appears more
than once)
Hi All,
I have a text file of 12k that I read the first 5 lines of with a
StreamReader.ReadLine() in a loop. The streamreader is then passed to
another method to read the last bit of text in the file.
I try something like:
// put the stream position to the end last 200 chars
sr.BaseStream.Seek(-200, SeekOrigin.End);
// read in the last 200 chars
string s = sr.ReadToEnd();
The variable s should be 200 chars long but it's 630.
The data should be the end of the file but it's the 630 chars following the
original 5 LineRead()'s.
The Position of the sr.BaseStream is showing the correct position before the
ReadToEnd().
From the position it is reading from, there is about 11k of text data but it
only reads 630 chars.
So, not only is it not reading from where the Position says it should, it's
not reading to the end of the file either.
Can someone shed some light on this for me please?
Thanks.
than once)
Hi All,
I have a text file of 12k that I read the first 5 lines of with a
StreamReader.ReadLine() in a loop. The streamreader is then passed to
another method to read the last bit of text in the file.
I try something like:
// put the stream position to the end last 200 chars
sr.BaseStream.Seek(-200, SeekOrigin.End);
// read in the last 200 chars
string s = sr.ReadToEnd();
The variable s should be 200 chars long but it's 630.
The data should be the end of the file but it's the 630 chars following the
original 5 LineRead()'s.
The Position of the sr.BaseStream is showing the correct position before the
ReadToEnd().
From the position it is reading from, there is about 11k of text data but it
only reads 630 chars.
So, not only is it not reading from where the Position says it should, it's
not reading to the end of the file either.
Can someone shed some light on this for me please?
Thanks.