static protected internal long CountFolderLength(string FolderPath)
        {
            long folder_length = 0;

            System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(FolderPath);
            System.IO.FileInfo[] fis = di.GetFiles();

            foreach (System.IO.FileInfo fi in fis)
                folder_length += fi.Length;

            System.IO.DirectoryInfo[] dis = di.GetDirectories();

            foreach (System.IO.DirectoryInfo cdi in dis)
            {
                folder_length += CountFolderLength(cdi.FullName);
            }

            return folder_length;
        }

相关文章:

  • 2022-02-26
  • 2022-12-23
  • 2021-07-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-19
猜你喜欢
  • 2021-11-07
  • 2021-08-15
  • 2022-01-01
  • 2021-05-25
  • 2022-12-23
  • 2021-08-20
  • 2022-12-23
相关资源
相似解决方案