Q:

Write a C# program to find the size of a specified file in bytes

0

Write a C# program to find the size of a specified file in bytes

Sample Output:

Size of a file: 31

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

using System;
using System.Collections.Generic;
using System.IO;

public class Exercise29 {
 public static void Main() {
        FileInfo f = new FileInfo("/home/students/abc.txt");
        Console.WriteLine("\nSize of a file: "+f.Length.ToString());
 }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now