Capturing an "external drive inserted" event in a Windows service

I am trying to write a super-simple podcast download service to a device for use. I guess he will like it:

Whenever a device is connected (via USB), it:

  • Removes everything from the device.
  • Checks all recent posts in a number of RSS podcasts
  • Download files to device
  • Informs the user of its completion.

I have some experience with Windows services, but I'm not sure how (using .NET / C #) to catch that "the media device / usb-hard drive has been connected." Any tips?

+3
source share
1 answer

The simplest solution would be to periodically list the devices!

CodeProject # : http://www.codeproject.com/KB/system/DriveDetector.aspx

+2

Source: https://habr.com/ru/post/1697577/


All Articles