| | |
| | | /// </summary> |
| | | public static void BatchDeleteLog() |
| | | { |
| | | |
| | | List<string> deleteFolder = new System.Collections.Generic.List<string>(); |
| | | string folderPath = @"d:\\Log"; |
| | | FolderHelper.ListDirectory(folderPath, 0, ref deleteFolder); |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 批次删除日志文件 |
| | | /// </summary> |
| | | public static void BatchDeleteLog(string folderPath, int days) |
| | | { |
| | | |
| | | List<string> deleteFolder = new System.Collections.Generic.List<string>(); |
| | | FolderHelper.ListDirectory(folderPath, 0, ref deleteFolder); |
| | | |
| | | foreach (var item in deleteFolder) |
| | | { |
| | | FileHelper.DeleteOldFiles(item, days);//删除一个月的数据 |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 往日志里追加内容 |
| | | /// </summary> |
| | | /// <param name="folder">日志目录</param> |