Пример #1
0
        private void HandleFiles(string path)
        {
            string allFiles = hostInstance.GetFiles(path);

            if (!allFiles.Equals("Thiết bị chưa sẵn sàng.\r\n"))
            {
                string[] files = allFiles.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
                foreach (string file in files)
                {
                    if (file != string.Empty)
                    {
                        string[]     temp = file.Split(new string[] { "|*|" }, StringSplitOptions.None);
                        ListViewItem item = new ListViewItem(temp[0]);
                        for (int i = 1; i < temp.Length; i++)
                        {
                            item.SubItems.Add(temp[i]);
                        }
                        listView1.Items.Add(item);
                    }
                }
            }
            else
            {
                MessageBox.Show("Lỗi");
            }
        }