判断盘符是否存在,获取所有盘符
string driveLetter = model.Filename.Substring(0, 2);
DriveInfo drive = new DriveInfo(driveLetter);
if (drive.IsReady == false)
{}
string[] rootPath = System.IO.Directory.GetLogicalDrives();
string volume = model.Filename.Substring(0, model.Filename.IndexOf(':')) + ":\\";
if (!rootPath.Contains(volume))
{
throw new Exception("目标路径盘符不存在。");
}
Directory.CreateDirectory(Path.GetDirectoryName(model.Filename));