summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions/Main.cs
diff options
context:
space:
mode:
Diffstat (limited to 'win/C#/Functions/Main.cs')
-rw-r--r--win/C#/Functions/Main.cs20
1 files changed, 20 insertions, 0 deletions
diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs
index 95a17cfb3..04d4d16b4 100644
--- a/win/C#/Functions/Main.cs
+++ b/win/C#/Functions/Main.cs
@@ -350,5 +350,25 @@ namespace Handbrake.Functions
return -1;
}
+ /// <summary>
+ /// Clear all the encode log files.
+ /// </summary>
+ public static void clearLogs()
+ {
+ string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
+ if (Directory.Exists(logDir))
+ {
+ DirectoryInfo info = new DirectoryInfo(logDir);
+ FileInfo[] logFiles = info.GetFiles("*.txt");
+ foreach (FileInfo file in logFiles)
+ {
+ if (!file.Name.Contains("last_scan_log") && !file.Name.Contains("last_encode_log") && !file.Name.Contains("tmp_appReadable_log.txt"))
+ {
+ File.Delete(file.FullName);
+ }
+ }
+ }
+ }
+
}
}