System.IO | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

System.IO

i have a path. "D:\user\IMG\Scan\ in last folder (Scan) There are three folders that is folder A, Folder B & folder C. what should i do for auto next folder after finished process in folder a for automatic to next folder (to Folder B) thanks before :)

5th Oct 2017, 11:34 PM
Yayang Suryana
Yayang Suryana - avatar
3 Answers
+ 2
https://code.sololearn.com/cGpa8Toctxgn/#cs List<string> direct = Directory.GetDirectories(@"d:\test").ToList(); foreach (var item in direct) { Console.WriteLine(
quot;file : {item}"); var tempevent = new DirectoryInfo(item); var _files =tempevent.GetFiles().OrderByDescending(p => p.CreationTime).ToList(); foreach (var itemb in _files) { Console.WriteLine(
quot;file : {itemb.FullName}"); } } Console.ReadLine();
6th Oct 2017, 12:03 AM
Ali Roostae‎
Ali Roostae‎ - avatar
+ 2
thanks for answer.. but how i can select next folder in last path?? D:\test\img\scan\folder a folder b folder c for example here i chose folder a, and next i can select folder b.
6th Oct 2017, 12:38 AM
Yayang Suryana
Yayang Suryana - avatar
+ 2
i have create a method for collect folder (folder a, folder b and folder c) in last path to listbox public void listFile (ListBox lsb, string _path,) { DirectoryInfo dinfo = new DirectoryInfo (_path); DirectoryInfo[] directory = dinfo.GetDirectories(); foreach (DirectoryInfo dir in directory) { lsb.Items.Add (fi); } } but i can't create method "NextFolder" how should i do sir..
6th Oct 2017, 12:45 AM
Yayang Suryana
Yayang Suryana - avatar