如何在访问文件夹时收到通知?
我的本地计算机上有一个共享文件夹。我希望每次有人尝试访问它时都能收到通知。有人可以给我一些提示吗?
我检查了 FileSystemWatcher 类,它只提供用于更改/创建/删除/重命名文件夹下的内容的事件,这不完全是我想要的。
我还尝试使用事件日志试听,如此处所示,但它并不完全是这样我也想要。
非常感谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要获取此信息,您需要文件系统筛选器驱动程序。
所以我刚刚找到了提供带有 .Net API 的驱动程序的商业供应商: Eldos Callback Filter
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
也可能不是您想要的,但您可以使用 wmi 列出连接,请检查监视 Windows 共享
Might also be something not exactly what you want but you can list connections using wmi, check Monitor Windows Share
据我所知,如果仅访问文件并且文件被修改,文件系统观察器会触发更改事件。
as far as i know the filesystemwatcher fires a changed event if the files are only accessed and if the files are modified.