This commit is contained in:
龙腾猫跃 committed 2026-05-04 09:38:58 +08:00
1 parent 888415867a
commit 3fe3412410
2 files changed
+2 -1

No files matched your search

+1
View File
@@ -32,6 +32,7 @@ public static class DirectoryUtils {
/// <summary>
/// 返回指定路径下的所有文件夹。
/// 路径不以分隔符结尾。
/// </summary>
public static IEnumerable<string> EnumerateDirectories(string path, string searchPattern = "*", bool topDirectoryOnly = false) {
if (!Exists(path)) return [];
+1 -1
View File
@@ -26,7 +26,7 @@ public static class PathUtils {
/// 若路径较长,则尽量将其转换为短路径。
/// 若输入的是文件夹路径,不保证其结尾是否有文件夹分隔符。
/// </summary>
public static string Shorten(string fullName, bool keepFileName = false) {
public static string ToShortPath(string fullName, bool keepFileName = false) {
if (string.IsNullOrEmpty(fullName) || fullName.Length <= 200) return fullName;
fullName = fullName.Replace('/', '\\');