I could get the directories (2012 ,2014...) and put them in a listbox1.
- `DirectoryInfo[] diri_info =new DirectoryInfo(FBD.SelectedPath).GetDirectories();
- foreach (DirectoryInfo dir in diri_info)
- {
- listBox1.Items.Add(dir);
- }

, And I tried to also get the files in a directory selected And display them in the listbox 2 and open selected file but files dosn't appear , how fix that please ?
- private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
- {
- DirectoryInfo dirictory_choisis =(DirectoryInfo)listBox1.SelectedItem;
- FileInfo[] files = dirictory_choisis.GetFiles();
- foreach (FileInfo file in files)
- {
- listBox2.Items.Add(file.FullName);
- }
- }
- }
- }
[1]: https://i.stack.imgur.com/rmtZH.png

Amit GuptaRank #190 · 12.8K reputationPosted Jun 2, 2017, 10:03 PM EDT
Karthi KeyanRank #1,926 · 762 reputationPosted Jun 2, 2017, 7:52 PM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Jun 3, 2017, 10:34 AM EDT
Mohamed Moumni44 reputationPosted Jun 3, 2017, 2:27 PM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Jun 3, 2017, 10:44 PM EDT
Mohamed Moumni44 reputationPosted Jun 4, 2017, 8:29 AM EDT