file get size c# code example
Example 1: c# get file size in bytes
long _fileSize = new System.IO.FileInfo(filePath).Length;
Example 2: C# get size of file
// Get the information about a file
FileInfo fi = new FileInfo(file);
// Print the file size to console
Console.WriteLine($"File size: {fi.Length} bytes");