We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
GetTotalSize
1 parent f6a652f commit dab916eCopy full SHA for dab916e
1 file changed
Common.BasicHelper/Utils/Extensions/StringHelper.cs
@@ -1,4 +1,5 @@
1
-using System;
+using Common.BasicHelper.IO;
2
+using System;
3
using System.IO;
4
using System.Text;
5
using System.Threading.Tasks;
@@ -123,4 +124,11 @@ public static void Throw<T>(this string? message) where T : Exception
123
124
/// <param name="path">路径</param>
125
/// <returns>完整路径</returns>
126
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);
134
}
0 commit comments