It depends on what you do with this text.
If the problem is with tracking or logging, I would say that it is best to use ETW (Event Tracing for Windows). This is a kernel level tracking tool that was built into Windows with Windows 2000, and it is much faster than doing I / O.
If you are not using .NET 2.0, you need to do a little Win32 API work to use it, and you need to create a provider class that you register with the system. It's a little complicated, but worth the effort.
If you are using .NET 3.5, the Etw managed classes can be found in System.Diagnostics.Eventing.
source share