Skip to content

Commit dab916e

Browse files
committed
💾 Feat(Ext): Use GetTotalSize extension to get size of a folder.
1 parent f6a652f commit dab916e

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

Common.BasicHelper/Utils/Extensions/StringHelper.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
using Common.BasicHelper.IO;
2+
using System;
23
using System.IO;
34
using System.Text;
45
using System.Threading.Tasks;
@@ -123,4 +124,11 @@ public static void Throw<T>(this string? message) where T : Exception
123124
/// <param name="path">路径</param>
124125
/// <returns>完整路径</returns>
125126
public static string GetFullPath(this string path) => Path.GetFullPath(path);
127+
128+
/// <summary>
129+
/// 获取给定路径的完整大小 (字节数)
130+
/// </summary>
131+
/// <param name="path">路径</param>
132+
/// <returns>给定路径的完整字节数</returns>
133+
public static long GetTotalSize(this string path) => DirectoryHelper.GetDirectorySize(path);
126134
}

0 commit comments

Comments
 (0)