Void getFileBydir (String DirPath, Ref ArrayList Al)
{
/ / List all files, add to Al
FOREACH (String File in Directory.GetFiles (DirPath))
Al.Add (file);
/ / List all the subfolders and call the getAllFileBydir themselves;
FOREACH (String Dir in Directory.GetDirectories (DirPath))
GetAllFileBydir (Dir, Ref Al);
}
After running this function, the Al is all files in the DirPath folder (including the subfolders);