From a1a367a749bfbdc0500316737cbac9846c4fdaff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E7=8C=AB=E8=B7=83?= <1043137532@qq.com> Date: Sat, 9 May 2026 12:53:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9=E6=B2=A1=E6=9C=89=E9=95=BF=E8=B7=AF=E5=BE=84=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Shared/Utils/DirectoryUtils.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Shared/Utils/DirectoryUtils.cs b/Shared/Utils/DirectoryUtils.cs index 6287ce5..8b5e2d5 100644 --- a/Shared/Utils/DirectoryUtils.cs +++ b/Shared/Utils/DirectoryUtils.cs @@ -101,9 +101,10 @@ public static class DirectoryUtils { if (toRecycleBin) { FileUtils.DeleteToRecycleBin(folder); // 删除到回收站 } else { - DeleteInternal(PathUtils.WithLongPath(folder)); // 永久删除 + DeleteInternal(folder); // 永久删除 static void DeleteInternal(string folder) { try { + folder = PathUtils.WithLongPath(folder); foreach (string filePath in DirectoryUtils.GetFiles(folder, true)) FileUtils.Delete(filePath); // 删除文件 foreach (string str in DirectoryUtils.GetDirectories(folder, true)) DeleteInternal(str); // 递归删除子文件夹 ResilientUtils.RetryOn(() => Directory.Delete(folder, true)); // 最终删除文件夹