void FileSystemAnalyzer::AnalyzeDirectory(const wchar_t* directoryPath) { // Traverse directory and subdirectories DirectoryTraverser traverser(directoryPath); while (traverser.Next()) { const wchar_t* filePath = traverser.GetFilePath(); // Check file age and type if (IsFileOldOrUnnecessary(filePath)) { // Mark file for cleanup AddFileToCleanupList(filePath); } } }
public void AnalyzeRegistry() { // Open registry hive using (RegistryKey hkLM = Registry.LocalMachine) { // Iterate through registry entries foreach (string subKeyName in hkLM.GetSubKeyNames()) { RegistryKey subKey = hkLM.OpenSubKey(subKeyName); // Check entry type and contents if (IsRegistryEntryUnnecessary(subKey)) { // Mark entry for removal AddRegistryEntryToCleanupList(subKey); } } } }
using Microsoft.Win32;

