How to get the list of removable disk in c#?
I want to get the list of removable disk in c#. I want to skip the local drives. Because i want the user to save the file only in removable disk. Lloyd Powell You will need to reference System.IO for this method. var driveList = DriveInfo.GetDrives(); foreach (DriveInfo drive in driveList) { if (drive .DriveType == DriveType.Removable) { //Add to RemovableDrive list or whatever activity you want } } Or for the LINQ fans: var driveList = DriveInfo.GetDrives().Where(d => d.DriveType == DriveType.Removable); Added As for the Saving part, as far as I know I don't think you can restrict where the