So this seems to me to be a simple looping issue it's just that I keep confusing myself over the logic.
So I want to count all the files within a folder, and then all the folders within that folder, I want to count the files that are in there too.
Which mean I have to loop through to check wether there is a folder and then check it until there are no more folders. But I can't write the algoritm because I keep confusing myself.
I'm pretty sure there is a standard algorithm for something like this but I can't remember the name.
This is what I have so far:
var rootDir = Directory.GetDirectories(@"C:\");
foreach (var dir in rootDir)
{
if (Directory.GetDirectories(dir).Length > 0)
{
}
}