使用C#的文件访问日志 [英] File access log using C#
问题描述
我想在C#中创建一个应用程序,它应该显示有关文件访问的所有细节。例如,
我在服务器中有一个共享目录,说K:\。并且user-1,user-2被访问指定目录中的file-1和file-2。然后我想得到一个日志,如
--------------------。
文件打开.......
K:\ file-1by user-1
--------- ------------。
用户打开文件.......
K:\ file-2 2
是否有任何选项可以使用C#执行此操作,我尝试使用FileSystemWatcher,但没有打开文件和被访问用户的用户名等事件。
有谁可以帮我这个?
-Manuprasad M
Hi,
I am trying to make an application in C#, it should display all the details about a file access. For example,
I have a shared directory in a server say "K:\". and the user-1 , user-2 are accessed file-1 and file-2 in the specified directory. Then I want to get a log like
--------------------.
File opened.......
"K:\file-1" by user-1
---------------------.
File opened.......
"K:\file-2" by user-2
Is there is any option to do this using C#, I tried with "FileSystemWatcher", but there is no event like file opened and username of the accessed user.
Can anyone help me on this?
-Manuprasad M
推荐答案
您可以使用 openfiles.exe [ ^ ]以查询网络用户打开的文件。
你可以检查以下代码项目文章以获取更多信息
监测Acc ess到网络上的共享文件 [ ^ ]
you can use openfiles.exe[^] to quary the files opened by network users.
you can check below Code project article for more information
Monitoring Access to Your Shared Files on Network[^]
这篇关于使用C#的文件访问日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!