//using System;
//using System.Runtime.InteropServices;
[DllImport("kernel32")]
private static extern int GetDriveType(string lpRootPathName);
private static bool DriveExists(string sLetter) {
if (!string.IsNullOrEmpty(sLetter)) {
sLetter = sLetter.Substring(0, 1).ToUpper();
if (System.Text.RegularExpressions.Regex.IsMatch(sLetter, "[A-Z]")) {
int DriveType = GetDriveType(string.Format(@"{0}:\", sLetter));
return ((DriveType > 0x1) && (DriveType < 0x7));
}
}
return false;
}