Calculate File Size in C# November 15, 2016 In order to calculate a file’s size in C#, you can use the FileInfo object and create some logic to calculate the physical KB, MB or GB of a file.