Looking for C# code for detecting removable drive (usb flash)
问题 I'm looking for a C# code snippet to give me a notification for when a USB drive is plugged into my PC in Windows Vista (or win7) 回答1: There's a class called DriveDetector over at Codeproject that sounds like it does what you want. 回答2: Look at WM_DEVICECHANGE. This message should be sent when a drive is inserted. 回答3: I know this is not exactly what you asked for, but if you want to check what devices are available at any moment in time, there's another way. You can use the WMI classes in