I was wondering if there is an option(in c#) to set an event handler which would run each time one of the USB ports are plugged/unplugged.
Asked
Active
Viewed 1,355 times
2
-
1This answer has decent solutions: http://stackoverflow.com/q/6003822/153923 – Jul 02 '15 at 13:54
-
That duplicate covers USB thumb drives. Replacing creation of `Win32_VolumeChangeEvent` instances with `Win32_PnPEntity` instances will allow any device change – including USB – to be detected. – Richard Nov 11 '15 at 13:50