查询连接到 USB 的设备 - Windows

发布于 2024-11-05 22:07:16 字数 394 浏览 1 评论 0原文

好吧,我查遍了互联网,看来如果不编写自己的驱动程序,我想做的事情几乎是不可能的。

我有一个连接到 USB 端口的设备,不幸的是,对于这种情况,它使用 USB 转 UART 驱动程序来模拟流式传输设备输出的串行端口。

但是,为了验证软件的许可证,我想确保我知道哪个设备连接到 USB 端口 - 不仅仅是品牌和型号,而且(希望)实际的序列号。如果不是序列号,至少有一些唯一标识符。

但我不确定在哪里或如何获得它。

UART 桥有一个 PNPDeviceID,但无论哪个设备插入端口,它似乎都不会改变。

我正在使用 C# 工作,据我所知,这也是一个限制。

所以我的问题是:在 C# 中使用 UART 桥驱动程序时,如何从 USB 连接设备获取唯一标识符?

提前致谢。

Well, I've looked all over the internet, and it appears that what I want to do is near impossible without writing my own driver.

I have a device attached to a USB port, and - unfortunately for this situation - it uses a USB to UART driver to emulate a serial port which streams the device output.

However, in order to validate a license for the software, I want to ensure that I know which device is attached to the USB port - not just the make and model, but (hopefully) the actual serial number. If not the serial number, at least some unique identifier.

But I'm not sure where or how to get that.

The UART Bridge has a PNPDeviceID, but that doesn't seem to change, regardless of which device is plugged into the port.

I'm working in C#, which, from what I've read, is also a limitation.

So my question is this: How can I get a unique identifier from a USB-attached device while using a UART Bridge driver in C#?

Thanks in advance.

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

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

发布评论

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

评论(2

煮茶煮酒煮时光 2024-11-12 22:07:16

您可以尝试这个库。此 中有一些示例代码MSDN 问题 也是如此。

You might try this library. There's some sample code in this MSDN question as well.

慢慢从新开始 2024-11-12 22:07:16

PnpDeviceID 实际上就是我正在寻找的。只是 EEPROM 必须更新,这在 Silicon Labs 的示例应用程序之一中得到了演示。 PnpDeviceID 由供应商 ID、产品 ID 和序列号组成,所有这些都可以通过演示的方法进行自定义。我的特定设备组上的序列号默认为 0001,这使得 PnpDeviceID 看起来没有更改。

请参考此处

The PnpDeviceID actually is what I was looking for. It's just that the EEPROM has to be updated, which is demonstrated in one of the sample applications from Silicon Labs. The PnpDeviceID consists of the Vendor ID, Product ID, and Serial Number, all of which are customizable via the method demonstrated. The Serial Number on my particular set of devices defaults to 0001, which makes it appear that the PnpDeviceID doesn't change.

Reference here.

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