How to Get the File Size in C# ?


This content was proof-read by Grammarly. You can Try Grammary for FREE

If you need a way to get the size of a file in your C# program , you can use the Length property of the FileInfo class.

How to Get the File Size in C# ?

FileInfo.Length returns the length of the file in bytes.

var lengthOfFile = new System.IO.FileInfo(path).Length
Newsletter Signup

Subscribe to our weekly newsletter below and never miss the latest product or an exclusive offer.

Newsletter Signup

Subscribe to our weekly newsletter below and never miss the latest product or an exclusive offer.

%d bloggers like this: