public static void InitFolderMd5(string system, string systemVersion, string parentPath, string dirPath,InitFileMd5Delegate initFileMd5) { DirectoryInfo dir = new DirectoryInfo(dirPath); if (dir.Exists) { FileInfo[] files=dir.GetFiles(); for (int i = 0; i < files.Length; i++) { if (initFileMd5 != null) { initFileMd5(system, systemVersion, parentPath, files[i]); } else { InitFileMd5(system, systemVersion, parentPath, files[i]); } } DirectoryInfo[] dirs = dir.GetDirectories(); for (int i = 0; i < dirs.Length; i++) { InitFolderMd5(system, systemVersion, parentPath,dirs[i].FullName,initFileMd5); } } }
public static void InitFolderMd5(string system, string systemVersion, string parentPath, string dirPath, InitFileMd5Delegate initFileMd5) { DirectoryInfo dir = new DirectoryInfo(dirPath); if (dir.Exists) { FileInfo[] files = dir.GetFiles(); for (int i = 0; i < files.Length; i++) { if (initFileMd5 != null) { initFileMd5(system, systemVersion, parentPath, files[i]); } else { InitFileMd5(system, systemVersion, parentPath, files[i]); } } DirectoryInfo[] dirs = dir.GetDirectories(); for (int i = 0; i < dirs.Length; i++) { InitFolderMd5(system, systemVersion, parentPath, dirs[i].FullName, initFileMd5); } } }