Is there a way to get the PID from a process that is blocking a file using C#?
Asked
Active
Viewed 357 times
1 Answers
6
I don't know whether it can be done entirely within the framework, but maybe you could call out to SysInternals' Handle.exe to do the heavy lifting here?

ZombieSheep
- 29,603
- 12
- 67
- 114
-
2+1 for using Handle.exe. It would be very difficult to implement such functionality in C#: http://stackoverflow.com/questions/177146/how-do-i-get-the-list-of-open-file-handles-by-process-in-c – Darin Dimitrov May 03 '09 at 09:54
-
Thanks for the link, @Darin. Interesting! – Cerebrus May 03 '09 at 10:51
-
Parsing handle output can be a simple and clean choice. Thanks :). – Ricardo May 15 '09 at 12:27
-
any sample (and real) source code in C# using Handle.exe ?? @Cerebrus, no thanks, only vote – Kiquenet Jan 13 '11 at 12:13