1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
saviour-backup-system/Saviour Backup System/mainWindow.cs

48 lines
1.3 KiB
C#
Raw Normal View History

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
namespace Saviour_Backup_System
{
public partial class mainWindow : Form
{
public mainWindow()
{
InitializeComponent();
refreshDriveList();
}
public void refreshDriveList()
{
DriveInfo[] drives = USBTools.getConnectedDrives();
connectedDrivesList.Items.Clear();
foreach (DriveInfo drive in drives){
ListViewItem driveItem = new ListViewItem(drive.Name + " " + drive.VolumeLabel);
driveItem.SubItems.Add("X");
connectedDrivesList.Items.Add(driveItem);
}
connectedDrivesList.Sort();
}
private void connectedDrivesListRefresh_Click(object sender, EventArgs e)
{
refreshDriveList();
}
private void connectedDrivesList_Click(object sender, EventArgs e)
{
string currentItem = connectedDrivesList.SelectedItems.ToString();
int index = connectedDrivesList.FindString(currentItem);
}
}
}