From 76965362217ff0a7292dc2b2c01157914ee04b46 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 15 Nov 2014 13:44:37 +0000 Subject: [PATCH] added code for listing drives and getting directory --- Saviour Backup System/addBackupWizard.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Saviour Backup System/addBackupWizard.cs b/Saviour Backup System/addBackupWizard.cs index 3ef486f..f01a4fd 100644 --- a/Saviour Backup System/addBackupWizard.cs +++ b/Saviour Backup System/addBackupWizard.cs @@ -7,14 +7,36 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using System.IO; namespace Saviour_Backup_System { public partial class addBackupWizard : Form { + private string folderPath = ""; public addBackupWizard() { InitializeComponent(); + populateDropdown(); + } + + private void directoryBrowseButton_Click(object sender, EventArgs e) + { + FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog(); + if (folderBrowserDialog.ShowDialog() == DialogResult.OK) + { + folderPath = folderBrowserDialog.SelectedPath; + } + folderBrowserDialog.Dispose(); //memory management + } + + private void populateDropdown() + { + DriveInfo[] drives = USBTools.getConnectedDrives(); + foreach (DriveInfo drive in drives) + { + drivesDropdown.Items.Add(drive.VolumeLabel); + } } } }