I am developing an application (using C#) that should check if a file is locked by another process or not. At the current stage of the implementation, I could detect if a PDF file is locked by Adobe reader. However, it's not possible when it's locked by a browser (e.g Mozilla FireFox).
I have tried the proposed solutions in the below stackoverflow threads, but all of them failed:
https://stackoverflow.com/questions/876473/is-there-a-way-to-check-if-a-file-is-in-use/11060322
How do I find out which process is locking a file using .NET?
Do you have any other suggestions ?