q; files in sub directories

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

private void getList()
{
string[] fList = Directory.GetFiles("c:\\Tmp");
listBox.DataSource = fList;
listBox.DataBind();
}


This codes brings all the files in the folder c:\tmp. How can make this code
return all the files in the sub directories too?
 
hi Jim,
the Directory.GetFiles() method in .Net 1.1 does not have the 'include
subdirectories' option you describe. The version in .Net 2.0 does include
this option as a 3rd parameter.

you could easily write your own using a recursive function with a few lines
of code. if this poses a problem let me know,
tim
 
Thanks I got this working.

Tim_Mac said:
hi Jim,
the Directory.GetFiles() method in .Net 1.1 does not have the 'include
subdirectories' option you describe. The version in .Net 2.0 does include
this option as a 3rd parameter.

you could easily write your own using a recursive function with a few lines
of code. if this poses a problem let me know,
tim


JIM.H. said:
private void getList()
{
string[] fList = Directory.GetFiles("c:\\Tmp");
listBox.DataSource = fList;
listBox.DataBind();
}


This codes brings all the files in the folder c:\tmp. How can make this
code
return all the files in the sub directories too?
 
Back
Top