Hey everyone!
Basicaly what i'm doing is showing MessageBoxes with the contents of a
folder tree...
Example:
rootFolder -Folder1 - Folder2 - Folder3 - F3File1
RFFile1 F1File1 F2File1
F3File2
RFFile2 F1File2 F2File2
F3File3
RFFile3 F1File3 F2File3
RF"name" or F#"name" is to tell you in wich folder a file is, it's just for
reference, RFFile1,for example, is in the Root Folder, and F2File3 is in
Folder2
My problem is: With the folowing code I can only get to the contents of
Folder2 which are Folder3, F2File1 etc etc...
but I can't get to the contents within Folder3.... could anyone suggest me
what to do? (I know it's quite simple, but i've been so many hours looking
at it that I can't see it!
protected void MessContents(DirectoryInfo root)
{
foreach (DirectoryInfo NextFolder in root.GetDirectories())
{
MessageBox.Show(NextFolder.Name);
foreach (FileInfo NextFile in root.GetFiles())
{
MessageBox.Show(NextFile.Name);
}
MessContents(CarpetaSiguiente);
}
}
Thnx in advance!
Benjamin Vigneaux,