I am writing a program that downloads files and sends the files over to a selected drive on the PC of the users choice. I have a ComboBox
that lists drives by their letters, however I cannot get the files to send over to the USB.
I have tried just manually with the drive letter:
ZipFile.ExtractToDirectory(@"./temp/setup.zip", @"H:\");
I have tried when the drive is set as a string as well. I get no error message, my program just freezes.
If anybody could give me a hand, that would be amazing!
EDIT: I am now getting this exception after a change I have made:
Split or spanned archives are not supported
I am getting this exception after the program just freezes for about 30 seconds.
Here is the change I made to my code:
private void startbutton_Click(object sender, EventArgs e)
{
if (devicepath == null)
{
MessageBox.Show("Select a device before continuing.", "Xub Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
if (Directory.Exists(@"./temp") == false)
{
Directory.CreateDirectory(@"./temp");
}
File.Move(@"./setup.xub", @"./temp/setup.zip");
// It is freezing on the line below:
ZipFile.ExtractToDirectory(@"./temp/setup.zip",
folderBrowserDialog1.SelectedPath);
}
}