How to check for file lock? [duplicate]

Is there any way to check whether a file is locked without using a try/catch block?

Right now, the only way I know of is to just open the file and catch any System.IO.IOException.

12 Answers
12

Leave a Comment