/* System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(Location); foreach (System.IO.FileInfo f in dir.GetFiles("*.*")) { //LOAD FILES ListViewItem lSingleItem = listView1.Items.Add(f.Name); //SUB ITEMS lSingleItem.SubItems.Add(Convert.ToString(f.Length)); lSingleItem.SubItems.Add(f.Extension); } */ //============================ // Find all folders in folder //============================ private void FoldersInFolders() { foreach (DirectoryInfo directoryInfo in _dir.GetDirectories()) { string subFolder = directoryInfo.FullName; Console.WriteLine(subFolder); _folderlist.Add(directoryInfo.FullName); AllFilesAndFolders.Add(directoryInfo.Name); // This should be changed // Console.WriteLine("Enters subfolder {0}", subFolder); DirectoryReader subfolder = new DirectoryReader(subFolder); subfolder.PrintFilesAndFolders(); foreach (string subfiles in subfolder.AllFilesAndFolders) { this.AllFilesAndFolders.Add(subfiles); } } }
private static void testTo(string musikFolder) { EntryText("DirectoryReader Test"); IOReader.DirectoryReader directoryReader = new DirectoryReader(musikFolder); directoryReader.PrintFilesAndFolders(); EntryText("DirectoryReader Test 2"); foreach (string afaf in directoryReader.AllFilesAndFolders) { Console.WriteLine(afaf); } }