Count all files

This commit is contained in:
ProfessionalUwU 2023-05-16 23:21:43 +02:00
parent 23f8158ebf
commit 2a8bf7e8fe
Signed by: ProfessionalUwU
GPG Key ID: 013AD77C0A9DD3F2
2 changed files with 8 additions and 2 deletions

View File

@ -5,7 +5,7 @@
Console.WriteLine("Starting the checksum process."); Console.WriteLine("Starting the checksum process.");
Console.ResetColor(); Console.ResetColor();
chksum.doTheThing(); Chksum.doTheThing();
Console.ForegroundColor = ConsoleColor.Green; Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Checksum process finished"); Console.WriteLine("Checksum process finished");

View File

@ -2,7 +2,7 @@
// Check if any file is in there // Check if any file is in there
// If there is a file. Calculate md5sum > filename.md5 // If there is a file. Calculate md5sum > filename.md5
// If there is no file. Repeat // If there is no file. Repeat
public class chksum { public class Chksum {
// int getDirectoryCount() { // int getDirectoryCount() {
// int folderCount = Directory.GetDirectories(Directory.GetCurrentDirectory()).Length; // Get folder count in current directory // int folderCount = Directory.GetDirectories(Directory.GetCurrentDirectory()).Length; // Get folder count in current directory
@ -47,4 +47,10 @@ public class chksum {
doTheThing(); doTheThing();
} }
} }
public static int getTotalFileCount() {
int totalFileCount = Directory.GetFiles(Directory.GetCurrentDirectory(), "*", SearchOption.AllDirectories).Length;
return totalFileCount - 1; // Remove the program from the totalFileCount
}
} }