Get Directory Size in .Net
/// Returns the size of the directory in bytes public static long Size(System.IO.DirectoryInfo dirInfo) { long total = 0; foreach(System.IO.FileInfo file in dirInfo.GetFiles()) total += file.Length; foreach(System.IO.DirectoryInfo dir in dirInfo.GetDirectories()) total += Size(dir); return total; }