监测在C#中的文件/目录的访问 [英] monitor file/directory access in C#
问题描述
我想开发它记录在计算机上访问的文件/目录中的应用程序。
I want to develop the application which logs the files / directories accessed on the machine.
例如。我去到D:\,并放到一个文件夹的文件和打开一个Word文件。我希望我的应用程序创建一个日志的格式如下:
e.g. I go to D:\ and into a folder documents and open a word file. I want my application to create a log in the following format:
- D:\开放
- D:\文件打开
- D:\文档\ secret.docx开放
我使用FileSystemWatcher的实现其它类型的文件系统的活动,但无法获得事件访问这一点。
I've used FileSystemWatcher to achieve the other type of file system activity but unable to get events for accessing this.
推荐答案
听起来就像你想要做一个FileMon的程序像SYS内部。在他们的网站马克讲述FileMon的工作原理,所以你可以通过阅读这篇文章得到一些启发的方式。
sounds like you wanna do a FileMon program like sys internals. in their website Mark tells about the way FileMon works so you can get some inspiration by reading the article.
在此还看到:<一href="http://stackoverflow.com/questions/290694/how-do-you-monitor-file-access-and-changes-on-a-file-server-by-user-name">How你监视的文件访问和用户名的文件服务器上的变化?
这篇关于监测在C#中的文件/目录的访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!