added code for listing drives and getting directory
This commit is contained in:
parent
31edb50c9b
commit
7696536221
1 changed files with 22 additions and 0 deletions
|
@ -7,14 +7,36 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace Saviour_Backup_System
|
namespace Saviour_Backup_System
|
||||||
{
|
{
|
||||||
public partial class addBackupWizard : Form
|
public partial class addBackupWizard : Form
|
||||||
{
|
{
|
||||||
|
private string folderPath = "";
|
||||||
public addBackupWizard()
|
public addBackupWizard()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue