Can now go back to the original root dir

This commit is contained in:
ProfessionalUwU 2023-05-16 19:36:11 +02:00
parent 0842fd37f4
commit 5d48f6b833
Signed by: ProfessionalUwU
GPG Key ID: 013AD77C0A9DD3F2

View File

@ -32,7 +32,8 @@ public class Program {
}
foreach (var directory in Directory.GetDirectories(Directory.GetCurrentDirectory())) {
Directory.SetCurrentDirectory(directory);
string parentFolder = directory;
Directory.SetCurrentDirectory(directory); // Set new root
if (getFileCount() >= 1) {
DirectoryInfo dir = new DirectoryInfo(Directory.GetCurrentDirectory());
FileInfo[] files = dir.GetFiles();
@ -43,6 +44,7 @@ public class Program {
File.AppendAllText(checksumFile, CalculateMD5(fileName) + " " + fileName);
}
}
Directory.SetCurrentDirectory(parentFolder); // Go back to the original root
}
}
}