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.
Loading
Javeed M ShaikhPosted Oct 31, 2011, 12:59 PM
using System.Web.UI.WebControls;
If it's Windows Forms then there isn't a
ListItemclass.ListBox.SelectedItemreturnsobject, notListItemGerade GeldenhuysPosted Oct 31, 2011, 12:56 PM
Javeed M ShaikhPosted Oct 31, 2011, 12:33 PM
foreach(ListItem l in ListBox1.Items)
{
if(l.Selected)
{
// copy code here...
}
}