How can i get user who deleted file?
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.
精彩评论