Code:
using System;
using System.IO;

public class Folder {
    private static double sizeInBytes; 

    public static double Size(string directory, bool deep) {
        DirectoryInfo dir = new DirectoryInfo(directory);
        foreach(FileInfo f in dir.GetFiles()) {
            sizeInBytes += f.Length;
        }
        if(deep) {
            foreach(DirectoryInfo d in dir.GetDirectories()) {
                Size(d.FullName, deep);
            }
        }
        return sizeInBytes;
    }

    static void Main() {
        Console.WriteLine("The total folder size in bytes is {0}",  Folder.Size(@"c:\sonysys", true));
    }
}