USB Drive Activity Logger!

csharp India
  • 13 years ago
    Hi Friends!

         M working on a project where I need to monitor a USB Device, ie., if a user plugs in a USB Drive and then copies any files from/onto it then I need to log those file copying activities. Can anyone suggest how that can be done?


  • 13 years ago

    You'll need something that works the same way as a packet sniffer. I'm not 100% sure about how to implement one, but it involves either installing a new network stack (that does the same thing but reports) or by adding something into the network stack.

    I'm not sure if it'll work for USB. You could write a file manager and then you'd have complete control over logging activities.

  • 13 years ago

    You need to do two things :

    1. Detect the connection/disconnection of an USB key. CodeProject has an article on detecting USB drives :
    2. Once a USB key is connected, monitor file changes on the key. The FileSystemWatcher component can be used to monitor changes from a directory.

    Hope this helps.

  • 13 years ago
    Hey William.. thanx Buddy for your Reply! I've been able to find out the solution to my problem! Thanx to You! :)

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In theory, theory and practice are the same. In practice, they're not.”