To get the size of the file in c#

Jitendrasoft09
Posted by Jitendrasoft09 under C# category on | Points: 40 | Views : 852
using System;
using System.IO;

class JkExample {

static void Main(string[] args) {

FileInfo myFile = new FileInfo(@"C:\jkfile.txt");


long fileSize = myFile.Length;
Console.WriteLine("File length: {0} bytes", fileSize);



Console.ReadLine();
}
}

Comments or Responses

Login to post response