How do you get the file size in C#? September 22, 2022 by Tarik If you have already a file path as input, this is the code you need: long length = new System.IO.FileInfo(path).Length;