Monday, August 25, 2014

file size

Hello there,


I need some help. I got a methode thats checks the size of my dir but only the main.. like C:/ or D:/ or F:/..


But i want when a user select a location like C:/user/thisdir/ that the methode only checks the size of C:/..


So a methode needs to select the first letter orsomthing and check the size of it..



DriveInfo[] allDrives = DriveInfo.GetDrives();

foreach (DriveInfo d in allDrives)
{
if (d.Name == GoPro1 || d.Name == GoPro2 || d.Name == GoPro3 || d.Name == GoPro4)
{
verbruik[teller] = ((d.TotalSize - d.TotalFreeSpace) / 1024 / 1024 / 1024 + " GB | | VRIJ: " + d.TotalFreeSpace / 1024 / 1024 / 1024 + " GB | | TOTAAL: " + d.TotalSize / 1024 / 1024 / 1024 + " GB");
teller = teller + 1;
}
}

This is what i have but it gives me errors when the user select a subfolder..


Hope you understand it,


Pasibun


No comments:

Post a Comment