VB.Net: Detect Webcam

删除回忆录丶 提交于 2020-01-05 06:31:15

问题


How can I programmatically detect whether a webcam device is plugged in to the PC or not, return 'True' or 'False.


回答1:


Might be some better way of doing this but the only one I can think of would be to use GetRawInputDeviceList to enumerate all USB devices and then using GetRawInputDeviceInfo to get out more information about them.
Webcams should show up as HID, but I don't know if there's any way to tell for sure if it's a webcam.

See here for a C# sample (could probably use a C# to VB.Net converter if you're not comfortable with C#).



来源:https://stackoverflow.com/questions/2946180/vb-net-detect-webcam

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!