I'm making launcher application, and in downloading part I need to fill the progress, so I need to know the size of the directory I downloading. I download it file by file from an FTP-server like this:
foreach(string dir in SubDirsArray)
{
bool has = CheckForSubdirs(dir);
if(has){GetAndAddToArray()}
else if(!has)
{
download()
progressbar.value += (DirSize / 100) / (filesize / 100);
}
}
its only simplified example code, not actual one btw
DirSize
should be initialized before that part of the code. And in order not to repeat this code and not to slow the downloading process I've searched for the way to get size without touching subdirectories and files, but I found nothing.
So is there any way to get size like that?