VB.Net:检测网络摄像头 [英] VB.Net: Detect Webcam

查看:349
本文介绍了VB.Net:检测网络摄像头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何以编程方式检测网络摄像头设备是否已插入PC,返回 True或 False。

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

推荐答案

可能是执行此操作的更好方法,但我唯一想到的方法是使用 GetRawInputDeviceList 枚举所有USB设备,然后使用 GetRawInputDeviceInfo 以获得有关它们的更多信息。

网络摄像头应显示为HID,但我不知道是否有任何方法可以确定它是否是网络摄像头。

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.

请参见此处用于C#示例(如果您对C#不满意,可以使用C#到VB.Net转换器)。

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

这篇关于VB.Net:检测网络摄像头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆