C # How to request WebCam from WMI?

I use this query in WMI to get all USB devices:

SELECT * FROM Win32_USBControllerDevice

The result is these sequential elements:

Antecedent: \\PC\root\cimv2:Win32_UsbController.DeviceID="PCI\VEN82......"
Dependent: \\PC\root\cimv2:Win32_UsbController.DeviceID="USB\\ROOT_HUB20..."

I want to find a WebCam Device, but I cannot find any hint for these elements. I think I was wrong?

I do not want to use a third-party partner Aforge.net for this, just to list webcams, I want to use only WMI.

So, did anyone help me please? thanks.

[Problem resolved]

use SELECT * FROM Win32_PnPEntity

+4
source share

Source: https://habr.com/ru/post/1612024/


All Articles