文件监视器 [英] File Monitor

查看:104
本文介绍了文件监视器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上我已经使用FileSystemWatcher函数开发了一个用于监视文件系统的程序。但是当文件或文件夹处于打开状态但它实际上只检测到文件夹或文件的修改时它没有通知。但实际上我想要检测谁试图打开
我的文件或文件夹,因为它受到保护。

Actually i have developed a program for monitoring file system using FileSystemWatcher function.but it did not notify when a file or folder at open but it actually detect only a modification of folder or file.But actually i want to detect who try to open my file or folder because it is protected.

我也尝试过使用FileSystemEventHandler函数但结果是一样的。

And also i have tried it by using FileSystemEventHandler function but the result is same.

是否有检测文件夹或文件打开过程的功能?如果是,请告诉我。

is there any function for detect a folder or file opening process?if it is please tell me.

提前致谢。

推荐答案

Windows无法通过日记功能API了解何时打开文件,这是FSW使用的。在文件打开时获得通知的唯一方法是使用文件系统过滤器。这需要了解内核驱动程序。它也不能是托管代码中实现的
。内核驱动程序仅支持C / C ++。你必须在Windows Driver论坛上发帖提问才能获得帮助。

Windows does not provide the ability to know when a file is open via the Journaling API, which is what FSW uses. The only way to get notified when a file is open is to use a file system filter. This requires knowledge of kernel drivers. It also cannot be implemented in managed code. Kernel drivers only support C/C++. You'll have to post questions in Windows Driver forums to get help with doing this.

Michael Taylor

http://www.michaeltaylorp3.net

Michael Taylor
http://www.michaeltaylorp3.net


这篇关于文件监视器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆