Exemple #1
0
        public static List <FileInfo> ScanFiles()
        {
            List <FileInfo> allFiles = new List <FileInfo>();

            foreach (String folder in FolderManager.loadList())
            {
                DirectoryInfo info = new DirectoryInfo(folder);
                if (info.Exists)
                {
                    foreach (FileInfo f in info.GetFiles())
                    {
                        allFiles.Add(f);
                    }
                }
            }

            return(allFiles);
        }
        public void RefreshFiles()
        {
            listBox1.Items.Clear();
            //rjf.Clear();
            int i = 0;

            foreach (String folder in FolderManager.loadList())
            {
                DirectoryInfo info = new DirectoryInfo(folder);
                if (info.Exists)
                {
                    listBox1.Items.Add(new ListInfo("-----------------------------", -1, null));
                    listBox1.Items.Add(new ListInfo(folder, -2, null));
                    listBox1.Items.Add(new ListInfo("-----------------------------", -1, null));
                    RJFile c;

                    foreach (FileInfo f in info.GetFiles())
                    {
                        c = new RJFile(f);
                        ListInfo info1 = new ListInfo(f.Name, i, c);
                        listBox1.Items.Add(info1);
                    }
                }
            }

            if (co != null)
            {
                co.Clear();
            }

            foreach (Object o in listBox1.Items)
            {
                co.Add(o);
            }

            filter();
        }
        private void 文件夹管理ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FolderManager fd = new FolderManager();

            fd.Show();
        }