feat: added system page to manage background tasks and get basic system information

This commit is contained in:
Michael Green
2023-07-04 09:20:42 +10:00
parent 26718b3cae
commit 48e8682a55
10 changed files with 331 additions and 27 deletions

View File

@@ -66,6 +66,24 @@ namespace gaseous_tools
}
}
}
}
public static long DirSize(DirectoryInfo d)
{
long size = 0;
// Add file sizes.
FileInfo[] fis = d.GetFiles();
foreach (FileInfo fi in fis)
{
size += fi.Length;
}
// Add subdirectory sizes.
DirectoryInfo[] dis = d.GetDirectories();
foreach (DirectoryInfo di in dis)
{
size += DirSize(di);
}
return size;
}
}
}