//Check whether the Drive Fetched from App.Config exists in the system if (Environment.SystemDirectory.Contains(DBDriveName) == true) { //Fetch the Drive Name exists with that in the App.Config and see there is enough space to create DB Back Up foreach (DriveInfo drivename in DriveInfo.GetDrives()) { //Fetching the free space of the drive from App.Config if existing and obtaining the same in MB if (drivename.IsReady && drivename.Name == DBDriveName) { TotalDiskFreeSpace = drivename.TotalFreeSpace / (1024 * 1024); } } } else { //Pass the msg if drive is not exisiting fetched from App.Config DbBackUpStatus = "Drive doesn't Exist"; }
GetDiskFreeSpaceEx
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)