示例#1
0
        private void button4_Click(object sender, EventArgs e)
        {
            int ret;

            if (comboBox1.SelectedItem != null)
            {
                listView1.Items.Clear();

                DeviceItem            item = (DeviceItem)comboBox1.SelectedItem;
                DeviceListener.Device d    = deviceListener.Find(item.id);
                if (d != null)
                {
                    string filename;
                    int    filesize;
                    ret = deviceListener.SDCardGetFirstFile(d, out filename, out filesize);
                    while (ret == 0)
                    {
                        ListViewItem ls = new ListViewItem("");
                        ls.Text = (listView1.Items.Count + 1).ToString();
                        ls.SubItems.Add(filename);
                        ls.SubItems.Add(filesize.ToString());
                        listView1.Items.Add(ls);

                        ret = deviceListener.SDCardGetNextFile(d, out filename, out filesize);
                    }
                }
            }
        }