Hi all. I'm writing a C# app to read a file that another application holds open. As some of you may guess, all I get is IOExceptions because "the file is being used by another process". I've tried tweaking File.Open() a little; this is my current try:
FileStream fsIn = File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
(I know that the FileShare flag is more meaningful for other processes that will access the file thereafter, but I have tried with it anyway.)
What puzzles me is that Notepad.exe will open the file just fine. Before I dig into Filemon for more clues, does any of you know how to open the file the way Notepad does? Thanks.