Oh My Dog
Oh My Dog

Reputation: 801

C# How to query WebCam from WMI?

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

SELECT * FROM Win32_USBControllerDevice

Result are serial items like this:

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

I want to find WebCam Device, but I cannot found any clue base on these items. I think I'm used a wrong way?

I don't want to use 3rd party such Aforge.net to do this just for listing WebCams, I want to use WMI only.

So, anyone would help me, please? thank you.

[Problem Solved]

use SELECT * FROM Win32_PnPEntity

Upvotes: 5

Views: 2994

Answers (0)

Related Questions