How to see if the text file is opened by another app?

Hi everyone,
I want to write .NET code to see if the text file is opened by another application, can anybody help me with this ?

Thank you all! ^^