private void recurseDirs(String rootdir) {
DirectoryInfo dirinfo = new DirectoryInfo(rootdir);
foreach(FileInfo fi in dirinfo.GetFiles()){
FileList.Items.Add(fi.FullName);
}
foreach(DirectoryInfo di in dirinfo.GetDirectories()){
recurseDirs(di.FullName);
}
}
Tuesday, May 27, 2008
Recurse directories with C#
I'm working on a C# program that recurses through directories, adding all the files to a list (I felt like trying out C#, and this was a good place to start). I found this VB.NET program doing something very similar, and adapted it to C#.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment