checking for Open Files

  • Thread starter Thread starter Oblivion
  • Start date Start date
O

Oblivion

Newbie question: I've been looking for a utility that lists ALL open
files and can't find one so I'd like to write one in .NET. How can I
check for FileLocks as they happen? For instance, if I open a PDF
file in Acrobat, the name of the PDF would be listed in my GUI. Is
there functionality for this natively in .NET or will I have to use COM
+?

Thanks in advance!
 
Hello Oblivion,

If file is opened by some process then this process should contain the handle
of this file.
Everything u need is to enumerate all processes and check the file handlers
they keeps

Read my post here http://groups.google.com/group/micr...f0ac/4fab929df9b84a4d?rnum=1#4fab929df9b84a4d
where I describe how to do this

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

O> Newbie question: I've been looking for a utility that lists ALL open
O> files and can't find one so I'd like to write one in .NET. How can I
O> check for FileLocks as they happen? For instance, if I open a PDF
O> file in Acrobat, the name of the PDF would be listed in my GUI. Is
O> there functionality for this natively in .NET or will I have to use
O> COM
O> +?
O> Thanks in advance!
O>
 
Back
Top