Calculate Size of a particular file

Hey @mgangrade7

FileInfo.Length will return the length of file, in bytes (not size on disk), so this is what you are looking for, I think.

If you have already a file path as input, this is the code you need:

long length = new System.IO.FileInfo(path).Length;

Regards…!!
Aksh

8 Likes