For example, you can list the removable drives:
using System.IO;
DriveInfo[] drives = DriveInfo.GetDrives();
foreach (DriveInfo drive in drives) {
if (drive.DriveType == DriveType.Removable)
}
Or, with LINQ:
using System.IO;
using System.Linq;
DriveInfo[] removableDrives =
DriveInfo.GetDrives().Where(drive => drive.DriveType == DriveType.Removable).ToArray();
To best of my knowledge, there is no a way to tell the flash drive from other removable drive. In a way, this is not really needed. In practice, you only may need to check if the access is read-only or you may to make sure the drive is not the system drive of a currently running OS (because you can always boot from a removable drive).
—SA