2

I am currently using FileSystemWatcher to monitor my local file system changes but i want to monitor Folder/File opening. after a lot of investigations, i found that this can be done using ReadDirectoryChangesW but i can't use this method along with FileSystemWatcher. My question is how to combine ReadDirectoryChangesW with FileSystemWatcher with a sample code on how to do this.

public class Watcher : FileSystemWatcher
{

}
yo2011
  • 971
  • 2
  • 12
  • 38
  • Your question makes no sense, FileSystemWatcher **is** a .NET wrapper for ReadDirectoryChangesW(). It does everything that the api function does. – Hans Passant Feb 22 '16 at 15:30
  • *but i want to monitor Folder/File opening. after a lot of investigations, i found that this can be done* Some reference on this? I see on MSDN That someone in 2013 asked for a `FILE_NOTIFY_CHANGE_FILEOPENSTATE`, but it seems it was a feature request. – xanatos Feb 22 '16 at 15:31
  • Hi Xanatos, Do you mean no solution exist for this issue? or the feature isn't implemented yet? – yo2011 Feb 22 '16 at 19:31
  • @yo2011 I mean "I don't know. I'm curious". You said that you've found, so it means that there is some documentation about it. I'd like to know. – xanatos Feb 22 '16 at 22:31

1 Answers1

0

To get events like accessed - you need to add an audit on this directory/files. Then you can consume audit entries to see who/when accessed file see more here

Community
  • 1
  • 1
profesor79
  • 9,213
  • 3
  • 31
  • 52