VB.Net:检测网络摄像头

发布于 2024-09-03 07:19:56 字数 49 浏览 3 评论 0原文

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

奈何桥上唱咆哮 2024-09-10 07:19:56

可能是更好的方法,但我能想到的唯一方法是使用 GetRawInputDeviceList 枚举所有 USB 设备,然后使用 GetRawInputDeviceInfo 获取有关的更多信息他们。
网络摄像头应该显示为 HID,但我不知道是否有任何方法可以确定它是否是网络摄像头。

请参阅此处获取 C# 示例(可能会使用 C# 到 VB.Net如果您不熟悉 C#,请使用转换器)。

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#).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文