Private void form1_load (Object sender, system.eventargs e) {string a = foldersize (@ "c: //") .tostring (); this.label1.text = a;} public static long folderfilesis (string path) {long Size = 0; try {fileinfo [] files = (New DirectoryInfo (PATH)). getFiles (); foreach (fileInfo file in files) {size = file.length;}} catch (exception ex) {messagebox.show ex.Message);} return size;} public static long FolderSize (string path) {long Fsize = 0; try {Fsize = FolderFileSize (path); DirectoryInfo [] folders = (new DirectoryInfo (path).) GetDirectories (); Foreach (DirectoryInfo Folder In Folders) {fsize = foldersize (folder.fullname);}} catch (exception ex) {messagebox.show;} returnif;}
--forward from
MDOT column