How to read a large (1 GB) txt file in .NET?

If you are using .NET 4.0, try MemoryMappedFile which is a designed class for this scenario.

You can use StreamReader.ReadLine otherwise.

Leave a Comment