Howdy all, Great to see the community up an running still. I'm just Hoping you guys/gals could help me again with something. Thanks in advance..

Ok Sit rep.

Need to be able to scan through all files in Given folder and list them with out tree in plain list box... and count each sub etc...

Currently using this method:-

void GetDirectorySubs(string PassDir, FileInfo ThisFile)
        {
            DirectoryInfo DirClass = new DirectoryInfo(PassDir);
            DirectoryInfo[] CurrDir = DirClass.GetDirectories();

            foreach(DirectoryInfo C_Direc in DirClass.GetDirectories())
            {
                Newfiles_lb.Items.Add(C_Direc.Name);
                   foreach(FileInfo C_files in DirClass.GetFiles())
                   {
                       Newfiles_lb.Items.Add( C_files.DirectoryName+" "+C_files.Name + @"\");

                      //if (DirClass.GetDirectories().Count() > 1)  GetDirectorySubs(C_files.DirectoryName, null);
                   }
            
            }

Now the Problem I have is that i have say this Strut on disc:

#1 folder\
#2 Folder\
#3 Folder\
etc.....

But each time i use the foreach dir in this dir command i only get the sub folder not all below..

I don't need a super routine....Just a simple loop while Directory.count less is Zero type solution...

My brains not being logical.....this month...It's manual writing month...ha ha
:confused:

This article has been dead for over six months. Start a new discussion instead.