开发者

How can i get user who deleted file?

开发者 https://www.devze.com 2022-12-25 06:09 出处:网络
I need to know which user deleted file in filesystem from c# code. Only 开发者_JAVA百科one idea is to use audit, but it seem to be very slow...You can use the FileSystemWatcher.Deleted event to captur

I need to know which user deleted file in filesystem from c# code. Only 开发者_JAVA百科one idea is to use audit, but it seem to be very slow...


You can use the FileSystemWatcher.Deleted event to capture deletes happening on the filesystem.

Depending on the application, you may at that point also be able to find out what user caused this event to occur (it is not part of FileSystemEventArgs).


I don't know if this can be retrieved from the filsystem, but one possible way is to use av FileSystemWatcher object to trigger an event on Deleted. The downside is that you need to have the watcher application running all the time. One upside is that you can monitor just a spesific folder if that's feasible.

0

精彩评论

暂无评论...
验证码 换一张
取 消