I have a program written in c# that controls a USB Camera. Sometimes, when starting the program, the camera does not appear to be connected in Windows 10 when the physical connection is solid. However, a reboot of the usb port (disable and re enable the driver) fixes the issue. This only happens sometimes but to alleviate problems down the road I was thinking of having my program do that reset while it is loading. I was wondering if there was a good class in c# I could use to disable and re enable USB ports? Also, just to note, I have tried using DEVCON and for some reason it just opens a command line window and closes it again very quickly without running any commands. So, I would prefer not to use that method if I don't have to. Any help and guidance would be greatly appreciated!
Asked
Active
Viewed 3,611 times
3
-
Possible duplicate of [Win32 API function to programmatically enable/disable device](http://stackoverflow.com/questions/1438371/win32-api-function-to-programmatically-enable-disable-device) – Keith Nicholas May 05 '17 at 05:14