WIP CrashReporter, misc refactoring

This commit is contained in:
Regalis
2015-09-19 15:14:47 +03:00
parent 16bf562837
commit f6966f06c3
86 changed files with 1616 additions and 631 deletions
+26
View File
@@ -177,5 +177,31 @@ namespace Subsurface
}
}
}
public static void CleanOldFiles()
{
string currentDir = Directory.GetCurrentDirectory();
string[] files = Directory.GetFiles(currentDir, "*", SearchOption.AllDirectories);
foreach (string file in files)
{
if (file.Length<4 || file.Substring(0,4)!="OLD_") continue;
System.Diagnostics.Debug.WriteLine("deleting file " + file);
try
{
File.Delete(currentDir + "\\" + file);
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine("Could not delete file ''" + file + "'' (" + e.Message + ")");
continue;
}
}
}
}
}