如何将卷号映射到USB设备ID? [英] How to map volume letter to USB device id?

查看:99
本文介绍了如何将卷号映射到USB设备ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我正在尝试将音量字母映射到USB设备ID。例如,有一个连接多个USB设备的USB集线器。我可以得到逻辑驱动器的列表,比如C,D,......,但不是安装的USB卷。我还可以获得连接到集线器的设备的详细信息。我的问题是我如何将哪个体积字母映射到哪个设备。



在此先感谢。



Yu



我的尝试:



Calling System.IO .Directory.GetLogicalDrives();获取逻辑驱动程序,但不是已安装的USB卷。

Hello,

I am trying to map the volume letter to USB device Id. For example, there is a USB hub connecting several USB devices. I can get the list of the logical drives, say "C", "D", ......, but not the mounted USB volumes. And I also can get the details of the devices that are connected to the hub. My question is that how I can map which volume letter to which device.

Thanks in Advance.

Yu

What I have tried:

Calling System.IO.Directory.GetLogicalDrives(); to get the logical drivers, but not the mounted USB volumes.

推荐答案

您尝试从所有设备(例如使用c#)过滤USB驱动器

You try filtering USB drives from all the devices such as-(example using c#)
List<string> usbDrives = new List<string>()
foreach (DriveInfo drive in DriveInfo.GetDrives())
{
    if (drive.DriveType == DriveType.Removable)
    {
        usbDrives.Add(drive.VolumeLabel);
    }
}





不确定是否能够找到集线器连接的USB驱动器。

请尝试一次,如果它不起作用,请告诉我。



谢谢:)



Not sure if it will able to find the USB drives connected at the hub.
Please try once and let me know if it doesn't work.

Thanks :)


这篇关于如何将卷号映射到USB设备ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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