If I've understood your question correctly, you're hosting your application files on a shared folder on your server, and want to see who has the file open on a different computer.
Doing this manually would involve opening the "shared folders" MMC snap-in, and looking at the "Open Files" folder.
As far as I can see, doing this in code would either involve P/Invoking the
NetFileEnum[
^] /
NetFileClose[
^] functions, or using the
IADsResource[
^] interface. There's a really old VBScript sample of option 2 in the archived Microsoft dev blogs:
How Can I List Open Sessions and Open Files on a Computer? - Scripting Blog [archived][
^]
Set objConnection = GetObject("WinNT://atl-ws-01/LanmanServer")
Set colResources = objConnection.Resources
For Each objResource in colResources
Wscript.Echo "Path: " & objResource.Path
Wscript.Echo "User: " & objResource.User
Wscript.Echo
Next
Note the comment at the end:
Quote:
We should point out that when we tested these close session and close file scripts they seemed to work just fine on Windows 2000 Server and Windows Server 2003. Results on Windows XP, however, were mixed at best. So, no guarantees; give them a try and see if they work in your environment.
To use this in C#, I believe you would need to use the
System.DirectoryServices namespace[
^]. There's an example in
this StackOverflow post[
^]