private void button6_Click(object sender, EventArgs e) { int ret; if (comboBox1.SelectedItem != null) { DeviceItem item = (DeviceItem)comboBox1.SelectedItem; DeviceListener.Device d = deviceListener.Find(item.id); for (int i = listView1.SelectedItems.Count - 1; i >= 0; i--) { ListViewItem ls = (ListViewItem)listView1.SelectedItems[i]; string filename = ls.SubItems[1].Text; ret = deviceListener.SDCardDeleteFile(d, filename); if (ret == 0) { listView1.Items.Remove(ls); } } } }