检查特定USB端口的DeviceID /名称 [英] Check Particular USB Port for DeviceID/Name

查看:673
本文介绍了检查特定USB端口的DeviceID /名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在VB.net或C#中创建一个小程序,即使是一个简单的C ++程序也能帮到我,但最好是在VB或C#中,因为这就是我所熟悉的。我需要检查设备是否连接到系统背面(主板)
的特定USB端口。这是因为系统上的第三方软件仅适用于连接到正确USB端口的设备。我的软件实际上只需要确认哪个设备连接到每个USB端口以进行故障排除。

I'm trying to create a small program, either in VB.net, or C#, even a simple C++ program would do me, but preferably in VB or C# as that's what I'm familiar with. I need to check if a device is connected to a particular USB port on the back (motherboard) of the system. This is because the third party software on the system will only work with devices connected to the correct USB ports. My software really only has to confirm which device is connected to each USB ports for troubleshooting purposes.

这怎么可能,我一直在坚持了几天,尝试了从WMI到
的所有内容
这个很长的C#应用​​程序
,但我一直无法查询系统上的特定USB端口,甚至返回可以链接到特定USB端口的结果。 任何代码段都将受到高度赞赏。 

How is this possible, I've been stuck on this for a few days and tried everything from WMI to this long C# application, but I've been unable to query specific USB ports on the system, or even return results that can be linked to particular USB ports. Any code snippets would be highly appreciated. 

推荐答案


 我需要检查设备是否是连接到系统背面(主板)上的特定USB端口。这是因为系统上的第三方软件仅适用于连接到正确USB端口的设备。我的软件实际上只需
就可以确认哪个设备连接到每个USB端口以进行故障排除。

 I need to check if a device is connected to a particular USB port on the back (motherboard) of the system. This is because the third party software on the system will only work with devices connected to the correct USB ports. My software really only has to confirm which device is connected to each USB ports for troubleshooting purposes.

嗨Darkest,

这可能取决于设备。

在某些情况下,DSR( SerialPort.DsrHolding )甚至是CTS( SerialPort.CtsHolding 当设备连接时,它将被引发。

In some cases, DSR (SerialPort.DsrHolding) or even CTS (SerialPort.CtsHolding) will be raised when the device is connected.

但在某些情况下,你可能只连接了Tx / Rx,唯一的方法就是尝试与设备通信。

But in some cases you may only have Tx / Rx connected, and the only way to tell is to attempt to communicate with the device.

如果它是一个特殊设备,那么它将提供一个驱动程序,并可能使用该接口的特定协议连接到的API。

If it's a special device then it will be supplied with a driver and possibly an API that you connect to using the speciic protocols of that interface.

您需要查看设备的文档。

You need to look at the documentation for your device.

最好的问候,

Cherry


这篇关于检查特定USB端口的DeviceID /名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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