This commit is contained in:
Chenx221 2024-08-28 21:13:05 +08:00
parent 0c0d82d311
commit 9440d5a065

View File

@ -89,20 +89,15 @@ namespace Comic_CBZ_Helper
DateTime currentDate = new(2020, 1, 1, 0, 0, 0);
int count = 0;
// 循环处理每个漫画文件夹
try
{
foreach (var comicFolder in comicFolders)
{
lock (consoleLock)
{
// 输出开始处理提示信息
Console.WriteLine($"开始处理漫画 {Path.GetFileName(comicFolder)}...");
}
// 检查漫画文件夹是否存在
if (!Directory.Exists(comicFolder))
{
throw new DirectoryNotFoundException($"漫画文件夹 {comicFolder} 不存在。");
Console.WriteLine($"漫画文件夹 {comicFolder} 不存在。");
return; //stop
}
// 临时存储重命名后的文件路径
@ -121,7 +116,7 @@ namespace Comic_CBZ_Helper
if (imageFiles.Length == 0)
{
Console.WriteLine($"在漫画文件夹 {comicFolder} 中未找到任何图像文件。");
return;//stop
return; //stop
}
// Sort the imageFiles using the NaturalSortComparer
@ -180,13 +175,6 @@ namespace Comic_CBZ_Helper
processedFolders++;
ShowProgress(processedFolders, totalFolders);
}
}
catch (DirectoryNotFoundException ex)
{
// 处理异常,例如输出错误信息并停止程序
Console.WriteLine(ex.Message);
PauseBeforeExit(count); // 停止程序,并等待用户按任意键退出
}
PauseBeforeExit(count);