C# is there a way to do a loop until end of file is reached?

I am working with a rather large text file and I was wondering if there was anyway to loop indefinately until the end of the file has been reached. I know in C++ there is an eof variable, but I can’t seem to find an equivalent in C#.

There is an MSDN example showing you exactly what you’re after.

Scroll down for the C# version. It’s there :slight_smile:

Cheers,
-Jon