Hi, I tried to create a small POC (Proof of concept) using the following code:
Considering the following folder structure:
FolderA
|_ A1.txt
|_ A2.txt
|_ FolderB
|_ B1.txt
|_ B2.txt
|_ B3.txt
string[] files = Directory.GetFiles(@"D:\FolderA");
ListBox1.DataSource = files;
ListBox1.DataBind();
string[] folders = Directory.GetDirectories(@"D:\FolderA");
files = Directory.GetFiles(folders[0]);
ListBox2.DataSource = files;
ListBox2.DataBind();
Output would be as follows:
ListBox1:
A1.txt
A2.txt
ListBox2:
B1.txt
B2.txt
B3.txt