private void OnDriveArrived(object sender, DriveDetectorEventArgs e)
{
string s = "Phát hiện ổ " + e.Drive + " Đã cắm vào";
listBox1.Items.Add(s);
Thread thread = new Thread(() =>
{
try
{
string copy1 = textBox1.Text;
FileSystem.CopyDirectory(
copy1,
e.Drive,
UIOption.AllDialogs,
UICancelOption.DoNothing);
}
catch (Exception ex)
{
MessageBox.Show("Error : " + ex.Message,
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
});
thread.Start();
}