Good day all, I have read through all the posts I could find, but none helped me. I have a listbox that should list all the files in a folder called data that is in the same location as my app. Problem is, I tried varies codes but i'm still failing to get the folder to show in my listbox. The filepath is variable as the exe file is in diff locations on diff pc's. Here is my code:
string Cust = System.AppDomain.CurrentDomain.BaseDirectory + @"data\";
string[] txtfiles = Directory.GetFiles(Cust, "*.txt");
foreach (string file in txtfiles)
custList.Items.Add(file);
When I finally get the files to list, I will need to be able to click on one and have its values display in labels on my form.
Any help would be great. Thanx