1
Fork 0

edited initial backup code, and added the call to it

This commit is contained in:
Jake Howard 2015-01-11 14:53:00 +00:00
parent b5c3d0cbae
commit ff69d41e24

View file

@ -28,8 +28,7 @@ namespace Saviour_Backup_System
SS = new splashScreen(); //displays the splash screen SS = new splashScreen(); //displays the splash screen
SS.description.Text = "From Setup..."; SS.description.Text = "From Setup...";
databaseTools.init(); databaseTools.init();
//startupBackups(); **this needs to be edited so that it uses newer code! startupBackups();
//run any initialising code here!
SS.Close(); SS.Close();
icon = new notificationIcon(); icon = new notificationIcon();
@ -42,29 +41,20 @@ namespace Saviour_Backup_System
DriveInfo[] drives = USBTools.getConnectedDrives(); DriveInfo[] drives = USBTools.getConnectedDrives();
List<string> driveIDs = new List<string>(); List<string> driveIDs = new List<string>();
List<string> drivesToBackup = new List<string>(); List<string> drivesToBackup = new List<string>();
foreach (DriveInfo drive in drives)
{ foreach (DriveInfo drive in drives) { driveIDs.Add(USBTools.calculateDriveID(drive)); }
driveIDs.Add(USBTools.calculateDriveID(drive));
} foreach (string id in IDs) { if (driveIDs.Contains(id)) { drivesToBackup.Add(id); } }
foreach (string id in IDs)
{ foreach (string id in drivesToBackup) {
if (driveIDs.Contains(id))
{
drivesToBackup.Add(id);
}
}
foreach (string id in drivesToBackup)
{
string directory = databaseTools.getBackupDirectory(id); string directory = databaseTools.getBackupDirectory(id);
string name = databaseTools.getDriveName(id); string name = databaseTools.getDriveName(id);
foreach (DriveInfo drive in USBTools.getConnectedDrives())
{ foreach (DriveInfo drive in USBTools.getConnectedDrives()) {
if (drive.VolumeLabel == name) if (drive.VolumeLabel == name) {
{ CT.startCopy(drive, directory, false);
CT.startCopy(drive, directory, true);
break; break;
} } else { continue; }
else { continue; }
} }
} }
} }