views:

198

answers:

1

I'm trying to write a super-simple podcast-to-device downloading service to use for running. I imagine that it'll like this:

Whenever a particular device is plugged in (via USB), it:

  • Deletes everything from the device
  • Checks for all the latest entries in a number of RSS Podcast feeds
  • Downloads those to the device
  • Notifies the user about when its done.

I have some passing experience with windows services, but am not sure how to (using .NET/C#) catch the 'media device/usb hard drive has been plugged in' event. Any advice?

+2  A: 

The simplest solution would be to periodically enumerate the devices!

CodeProject has a comprehensive C# article for this here : http://www.codeproject.com/KB/system/DriveDetector.aspx

Ray Hayes
Perfect :). Thanks!