Tuesday, September 18, 2018

Read off the length in bytes of a flat file in C#.

public long GetFileLength(string x)
{
   using (FileStream fileStream = new FileStream(x, FileMode.Open, FileAccess.Read))
   {
      return fileStream.Length;
   }
}

No comments:

Post a Comment