Get File Length - CSharp File IO

CSharp examples for File IO:File

Description

Get File Length

Demo Code


using System;//  www . j ava  2  s  .c om

public class Main{


      /*******************************/
      public static long FileLength(System.IO.FileInfo file)
      {
         if (System.IO.Directory.Exists(file.FullName))
            return 0;
         else 
            return file.Length;
      }
}

Related Tutorials