0

Possible Duplicate:
How does one figure out what process locked a file using c#?

When you try to open a locked excel file, for example, you see a message displaying the name of the user currently using the file. How do I get the same info using .NET?

Community
  • 1
  • 1
John Smith
  • 4,416
  • 7
  • 41
  • 56
  • 1
    If I remember correctly, this information is stored specifically by Excel (and other Office products) in the little temp files it creates alongside a file when you open it. They're not using a filesystem feature. On the other hand, there is a facility for Administrators to view open remote file handles, but that wouldn't help if you're dealing with a user who has the file open locally on the machine with the share. – Damien_The_Unbeliever Sep 12 '12 at 12:28

1 Answers1

0

Look at WhoSLocking. It is a C++ app that comes with source code and shows you which users are locking a file.

Also look at Using C#, how does one figure out what process locked a file? for a code sample of getting the process that locked the file. It may help you converting the C++ code in the first link.

Community
  • 1
  • 1
akton
  • 14,148
  • 3
  • 43
  • 47