Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Track copied files [duplicate]

I am trying to keep track of files that are copied by users and other applications. The FileSystemWatch only has events for Changed, Created, Deleted, Disposed, Error, and Renamed. It doesn't fire an event when a file is accessed by the copy function or where the new file is being copied to.

Is there a method for monitoring the copy event/function of windows?

like image 228
John Avatar asked Jan 06 '12 15:01

John


1 Answers

I don't know of any way using C#.

You can do this if you are willing to write a File System Filter Driver. [Definitely expert territory, as there is scope for corrupting files and/or bringing down your system]

A file system filter driver intercepts requests targeted at a file system or another file system filter driver. By intercepting the request before it reaches its intended target, the filter driver can extend or replace functionality provided by the original target of the request. Examples of file system filter drivers include anti-virus filters, backup agents, and encryption products. To develop file systems and file system filter drivers, use the IFS (Installable File System) Kit, which is provided with the Windows Driver Kit (WDK).

like image 170
Mitch Wheat Avatar answered Sep 22 '22 14:09

Mitch Wheat