C# how to know if removable disk is a usb drive, or a sd card?
问题 Windows 7 platform, C# I use the following statement to list all drives: DriveInfo[] drives = DriveInfo.GetDrives(); then I can use DriveType to find out all those removable disks: foreach (var drive in drives) { if(drive.DriveType == DriveType.Removable) yield return drive; } now my problem is, SD-card disk and USB flashdisk shared same driveType: Removable, so how can i only find USB flashdisk out? thanks! 回答1: You can take advantage of ManagementObjectSearcher using it to query the disk