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.
Copying files to a removable disk
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Javeed M ShaikhRank #839 · 2.7K reputationPosted Oct 31, 2011, 8:33 AM EDT
foreach(ListItem l in ListBox1.Items)
{
if(l.Selected)
{
// copy code here...
}
}
Gerade Geldenhuys16 reputationPosted Oct 31, 2011, 8:56 AM EDT
Javeed M ShaikhRank #839 · 2.7K reputationPosted Oct 31, 2011, 8:59 AM EDT
using System.Web.UI.WebControls;
If it's Windows Forms then there isn't a
ListItemclass.ListBox.SelectedItemreturnsobject, notListItem