Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何以编程方式检测网络摄像头设备是否已插入 PC,返回“真”或“假”。
可能是这样做的更好方法,但我能想到的唯一方法是GetRawInputDeviceList用来枚举所有 USB 设备,然后GetRawInputDeviceInfo用来获取有关它们的更多信息。 网络摄像头应该显示为 HID,但我不知道是否有任何方法可以确定它是否是网络摄像头。
GetRawInputDeviceList
GetRawInputDeviceInfo
有关 C# 示例,请参见此处(如果您对 C# 不满意,可能会使用 C# 到 VB.Net 转换器)。