tags:

views:

74

answers:

3

I have a shared folder on my local machine. I want to get notified every time someone tries to access it. Could someone give me some hint on this?

I have checked the FileSystemWatcher class, it only provides events for change/creation/delete/rename of the contents under the folder, which is not exactly what I want.

I also tried to use the event log audition as shown here, but it is just not exactly what I want, either.

Many thanks.

A: 

as far as i know the filesystemwatcher fires a changed event if the files are only accessed and if the files are modified.

Jack
+1  A: 

Might also be something not exactly what you want but you can list connections using wmi, check http://stackoverflow.com/questions/1448384/monitor-windows-share

Mikael
+1  A: 

To get this information you need a File System Filter Driver.

So i just found the commercial vendor that offers a driver with a .Net API: Eldos Callback Filter

Oliver
Thanks Oliver. I thought about the File System Filter Driver. But kind of itimidated by the complexity. Since you mentioned it, too. I will take a look. Thanks. :)
smwikipedia
a while ago i stumbled across a commercial product where they implemented such a driver and gave you a .Net API on the other side. But i just can't find it anymore. :-((
Oliver
@Oliver - if you ever remember, please post here :)
Cocowalla
@Cocowalla: A search today leads me to the wished result. Take a look into my updated answer.
Oliver
Thanks Oliver - this looks really good, though the pricing looks like it's on the high side. I'll check out the trial version
Cocowalla
@Cocowalla: Yes the prices are really high, but if you see the complex problem they solved and how many programming hours needed i think the price is okay (if it works as expected, never tried it on myself!)
Oliver
I just tried this out and within a few minutes it rebooted my machine, without warning. I think they have some reliability issues, so with regret I don't think I can use this :(
Cocowalla
I let the sales guy who contacted me with the trial license know about my problem... wow, I've never known a sales guy to be so damn rude! Not getting a good impression at all, which is unfortuanate because I can't find anything similar :(
Cocowalla