+ 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 :)
3 Respuestas
+ 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();
+ 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.
+ 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..