I need to open a txt file for read only while another program updates the txt file.
I have been copying the file with File.Copy() but the txtfile gets up to 5+ megs sometimes and the program becomes really slow.

I tried to use the following code....

FileStream fs = new FileStream(@"c:\results.txt", FileMode.Open, FileAccess.Read, FileShare.Read);

but it gets this error because the txt file is open

The process cannot access the file 'c:\results.txt' because it is being used by another process.


Is there any way open the txt file for read only when it is locked by another process?