Click here to Skip to main content
15,031,219 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have no clue at all, how to make this work.

What i'm trying to accomplish is, making my CheckedListBox read all embedded files in my project in a folder.

My current code to retreive items from a folder, how would i go around and read it from the project. And list all of the items.

What I have tried:

string path = @"C:\Test";
System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(path);
System.IO.FileSystemInfo[] files = di.GetFiles();
checkedListBox1.Items.AddRange(files);
Posted
Updated 9-May-21 11:15am
Comments
Gerry Schmitz 30-Mar-21 11:38am
   
Read the project file if you want to identify what's "embedded".
Dave Kreskowiak 30-Mar-21 12:43pm
   
Are you asking how to get the list of files in the same folder as your executable (.exe file)?

1 solution

Are you assuming that there are no sub folders in the folder you are wanting to read from ? I would suggest looking for examples of recursively finding files/folders from a root folder and processing them according to their type ( folder or file).
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900