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

前端 未结 3 1321
深忆病人
深忆病人 2020-12-03 23:51

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)

3条回答
  •  孤街浪徒
    2020-12-03 23:57

    Look at WM_DEVICECHANGE. This message should be sent when a drive is inserted.

提交回复
热议问题