Solution: Get Directory Size (Bytes, KB, MB, GB) included all sub folders

Below is the solution:-

1.1 Get Directory Size (Sequence)
Private = False
Variables
Dir_info(DirectoryInfo)
Size_of_Dir(Int64)
includeSubDir_size(Int64)
Activities
1.19 Assign (Assign)
To = Dir_info
Value = new DirectoryInfo(in_Directory)
Private = False
1.14 Assign (Assign)
To = Size_of_Dir
Value = Dir_info.EnumerateFiles(*, SearchOption.AllDirectories).Sum(function(f) f.Length)
Private = False
1.11 Write line (WriteLine)
Text = Size in Bytes=+Size_of_Dir.ToString
Private = False
1.14 Assign (Assign)
To = out_Bytes
Value = Size_of_Dir.ToString
Private = False
1.8 Write line (WriteLine)
Text = Size in KB=+(Convert.ToDouble(Size_of_Dir) / 1024).ToString
Private = False
1.18 Assign (Assign)
To = out_KB
Value = (Convert.ToDouble(Size_of_Dir) / 1024).ToString
Private = False
1.5 Write line (WriteLine)
Text = Size in MB=+(Convert.ToDouble(Size_of_Dir) / (1024*1024)).ToString
Private = False
1.5 Assign (Assign)
To = out_MB
Value = (Convert.ToDouble(Size_of_Dir) / (1024*1024)).ToString
Private = False
1.2 Write line (WriteLine)
Text = Size in GB=+(Convert.ToDouble(Size_of_Dir) / (1024*1024) / 1000).ToString
Private = False
1.2 Assign (Assign)
To = out_GB
Value = (Convert.ToDouble(Size_of_Dir) / (1024*1024) / 1000).ToString
Private = False

in “1.14 Assign (Assign)” I get that .Lenght is not a member of System.IO.FileInfo following all instructions.

.Lenght vs .Length was it a spelling?

1 Like

Omg im blind, an apology and thanks again! you are such a hero.

Get Directory Size.xaml (8.5 KB)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.