The .NET FileSystemWatcher’s Changed event MSDN documentation says:
The Changed event is raised when changes are made to the size, system attributes, last write time, last access time, or security permissions of a file or directory in the directory being monitored.
However, when I try to use this class to capture NTFS security changes to a directory or a file the Changed event never fires.
Is there some way of accomplishing this without polling?
FileSystemWatcherdoes watch security permissions changes.You need to include
NotifyFilters.Securityflag, when you setFileSystemWatcher.NotifyFilter.I tried the code below, changed permissions for a file in
Tempfolder. TheChangedevent was triggered.