How do I detect a USB drive letter from a c# application?
问题 How to detect the USB drive letter from c# program which is not residing in the USB? The program should reside in the system, if multiple USB's are connected then i should first able to get the manufacturer name also. 回答1: This will get all of the removable drives attached (including USB drives): foreach (DriveInfo drive in DriveInfo.GetDrives()) { if (drive.DriveType == DriveType.Removable) { // Code here } } Getting the USB drive manufacturer may be more difficult, and you may need to use