winapi - How to detect Cameras attached to my machine using C# -
i able know sound devices , usb devices attached pc not getting way find cameras attached machine. used below code sound devices
console.writeline("win32 sounddevices\r\n==============================="); managementobjectsearcher searcher = new managementobjectsearcher("select * win32_sounddevice"); foreach (managementobject sounddevice in searcher.get()) { //console.writeline("device found: {0}\n", sounddevice.tostring()); console.writeline("device found: {0}\n", sounddevice.getpropertyvalue("productname")); } console.writeline("search complete.");
this tool prove helpful:
http://www.microsoft.com/en-us/download/details.aspx?id=8572
i'm there's no equivalent string can send managementobjectsearcher()
webcams specifically. there "win32_usbcontrollerdevice" can determine if webcam or not.
a better solution altogether take advantage of directshow.net
Comments
Post a Comment