"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
http://www.pobox.com/~skeet/csharp/parameters.html which has a brief
explanation of reference types. (Must write a full article about that
some time...)
Hi. Thanks for the explanation. I understand now, that I need two different
StreamReaders (or is it Streams?). Anyway, I don't think this is possible
since the source data is a file. If I try to create a second Stream and
StreamReader, i get a "file in use" exception. (Also see my reply to Kevin's
post).
Should I be doing this another way perhaps?
Definitely. You'll probably need to write your own buffering reader
though - either that or seek back to the original place in the base
stream and call DiscardBufferedData (assuming your stream supports
seeking).
Wow! Writing my own buffering reader sounds a little too complicated for me.
:)
Is there a way to "save" the position of a StreamReader and seek back to it
at after reading a couple of lines ahead? How?
Or would I have to save the current line as a string, close the stream,
reopen it, and seek forward until I get to the same string where I left off?
Sounds like a bad way to to it, performance wise, although the log files are
"only" 3-4 megs in size.
Any other ideas on how to do this?
/Anders