Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

How to use ManagementObject or Win32_USBController class in C# to reset device (Kinect in my case) contected to usb port?

$
0
0

Hello,

I have one Kinect device that sometiomes I have to unplug and plug again to make it work. I'm trying to reset usb port using C# programming. I have been searching on internet how can I do it, but I don't find the answer. I have found this code to search usb controllers:

ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_USBController");
ManagementObjectCollection objs = searcher.Get();

foreach (ManagementObject wmi_HD in objs)
{
    string usb = wmi_HD["Caption"].ToString();
    ...
}

In Win32_USBController class documentation I see that there is a way to implemente Reset method, but I don't know how to do it...

How can use ManagementObject or Win32_USBController to reset the usb controller?

Thanks.


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>