.NET FileSystemWatcher来检测NTFS安全更改

| .NET FileSystemWatcher \的Changed事件MSDN文档说:   对受监视目录中的文件或目录的大小,系统属性,上次写入时间,上次访问时间或安全权限进行更改时,将引发Changed事件。 但是,当我尝试使用此类捕获NTFS安全性更改到目录或文件时,Changed事件从不触发。 有没有某种方法可以完成此任务而无需轮询?     
已邀请:
        
FileSystemWatcher
观看安全权限的改变。 设置
FileSystemWatcher.NotifyFilter
时,需要包括
NotifyFilters.Security
标志。 我尝试了下面的代码,更改了
Temp
文件夹中文件的权限。
Changed
事件被触发。
public static void Main()
{
    var fileSystemWatcher = new FileSystemWatcher(\"C:\\\\Temp\", \"*.*\");
    fileSystemWatcher.NotifyFilter = NotifyFilters.Security;
    fileSystemWatcher.Changed += fileSystemWatcher_Changed;
    fileSystemWatcher.EnableRaisingEvents = true;
    Thread.Sleep(-1);
}

private static void fileSystemWatcher_Changed(object sender, FileSystemEventArgs e)
{
}
    

要回复问题请先登录注册