Search code examples
c#.netwindowsfilesystemwatcher

How to use a FileSystemWatcher for monitoring new drives


Possible Duplicate:
Looking for C# code for detecting removable drive (usb flash)

How could the System.IO.FileSystemWatcher class be used to detect drives (e.g. F:) being connected/disconnected under windows? If this is not possible, what other event driven ways are possible (other than polling DriveInfo.GetDrives())?

Thanks in advance.


Solution

  • Take a look at this:

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