在Windows中访问本地文件时获取通知 [英] Getting a notification when a local file is accessed in windows
问题描述
Userland
代码 - by CreateFile()
/ NtCreateFile()
)我已经知道 FileSystemWatcher
这应该在 .NET
环境中完成,但是我在事件
会是完美的,但是发送一个回调
来调用也是可行的。
I'd like to get notified when a specific file get accessed (AFAIK, most generally for a Userland
code - by CreateFile()
/ NtCreateFile()
)
I already know about FileSystemWatcher
which should do the same within the .NET
environment, But I'm working in plain C
+ WinAPI
.
As for the type of notification , raising a specified Event
would be perfect, but sending a callback
to be called , will also work.
See FindFirstChangeNotification function in WinAPI and related links.
Alternatively, when functionality of that function is not enough, you can use a filesystem filter driver (write yours or use our CallbackFilter product).
这篇关于在Windows中访问本地文件时获取通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!