Gerade Geldenhuys

Gerade Geldenhuys

  • NA
  • 16
  • 9.4k

Copying files to a removable disk

Oct 31 2011 12:19 PM
what do I change to this code to copy all the files in the list-box?

FileInfo fi = new FileInfo(listBox1.SelectedItem.ToString());

string name = fi.Name;

label6.Text = name;

int size = Convert.ToInt32(fi.Length);

label4.Text = (Convert.ToInt32(size) / 1024).ToString() + "KB";

fi.CopyTo(comboBox1.SelectedItem.ToString()+ name);

Of course I use an openfiledialog to add the files to the list box.

Answers (3)