2019年3月2日

整体读入cmd结果,而不是分行读入,效率极高

摘要: public static long GetDirectorySize(string path) { long res = 0; System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo.FileName 阅读全文

posted @ 2019-03-02 14:53 mol1995 阅读(271) 评论(0) 推荐(0) 编辑

获取文件夹总大小方法2_获取cmd命令结果,效率最高

摘要: public static long GetDirectorySize(string path) { long res = 0; System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo.FileName 阅读全文

posted @ 2019-03-02 14:52 mol1995 阅读(676) 评论(0) 推荐(0) 编辑

获取文件夹总大小方法1_递归,效率极低

摘要: public static long GetDirectoryLength(string dirPath) { //判断给定的路径是否存在,如果不存在则退出 if (!Directory.Exists(dirPath)) return 0; long len = 0; //定义一个Directory 阅读全文

posted @ 2019-03-02 14:32 mol1995 阅读(204) 评论(0) 推荐(0) 编辑

导航