using System.IO;
/// <summary> 获取U盘或移动硬盘等设备 </summary>
public static List<string> Get_UsbDisk_List()
{
DriveInfo[] di = DriveInfo.GetDrives();//检索计算机上的所有逻辑驱动器的驱动器名称
List<string> Div = new List<string>();
foreach (DriveInfo d in di)
{
string DriveName = d.Name.ToUpper();
if (d.DriveType == DriveType.Removable && !DriveName.Contains("A") && !DriveName.Contains("B"))
{//获取U盘或移动硬盘等设备
Div.Add(d.Name);
}
}
return Div;
}