Sabari Prabu

Sabari Prabu

  • NA
  • 10
  • 2.6k

Windows Form Application using C#

Apr 21 2015 7:52 AM
I need to give a folder as input to the listbox and retrive the files in that folder to the listbox with some filterations.
Can anyone help me with the code???
 
I tried with the below code. I didn't give any filterations. i named the listbox as listlog.
But when executing the package, its showing empty listbox only. 
 
private void listlog_SelectedIndexChanged(object sender, EventArgs e)
{
string[] files = Directory.GetFiles("D:\\General");
foreach (string i in files)
{
listlog.Items.Add(i);
}
 

Answers (2)