Disable and re-enable USB port in C # .NET.

I have a program written in C # that controls a USB camera. Sometimes, when starting the program, the camera won't connect in Windows 10 when the physical connection is solid However, restarting the USB port (disable and re-enable the driver) fixes the problem. This happens sometimes, but to ease the problems down the road I was thinking of having my program do this reset while it loads. I was wondering if there is a good class in C # that I could use to disable and re-enable USB ports? Also, just to note, I tried using DEVCON and for some reason it just opens a command prompt window and closes it very quickly without executing any commands. So I would rather not use this method if I don't need it. Any help and guidance would be greatly appreciated!

+3


source to share





All Articles