mirror of
https://github.com/netchx/netch.git
synced 2026-03-14 17:43:18 +08:00
修复:当logging文件夹存在时,程序启动崩溃
This commit is contained in:
@@ -24,7 +24,17 @@ namespace Netch
|
||||
// 清理上一次的日志文件,防止淤积占用磁盘空间
|
||||
if (Directory.Exists("logging"))
|
||||
{
|
||||
Directory.Delete("logging", true);
|
||||
DirectoryInfo directory = new DirectoryInfo("logging");
|
||||
|
||||
foreach (FileInfo file in directory.GetFiles())
|
||||
{
|
||||
file.Delete();
|
||||
}
|
||||
|
||||
foreach (DirectoryInfo dir in directory.GetDirectories())
|
||||
{
|
||||
dir.Delete(true);
|
||||
}
|
||||
}
|
||||
|
||||
// 预创建目录
|
||||
|
||||
Reference in New Issue
Block a user