Search notes:

System.IO.FileStream (class)

System.IO.FileStream derives from System.IO.Stream

Length

The Length property provides an easy way to determine the size of a file in bytes:
using System;
using System.IO;

class Prg {
   static void Main() {
      FileStream fs = new FileStream("Length.cs", FileMode.Open, FileAccess.Read);
      Console.WriteLine($"Size of {fs.Name} is {fs.Length} bytes");
   }
}
Github repository .NET-API, path: /System/IO/FileStream/Length.cs

See also

System.IO.FileAccess, System.IO.FileMode
The methods Create() and Open() of the System.IO.FileInfo class.

Index