Returns the size of a folder, including all files in all subfolders, and the file count.
path must include a trailing backslash
| C# | Visual Basic | Visual C++ |
Public Shared Function GetFolderSize ( _ p_Path As String, _ <OutAttribute> ByRef p_FileCount As Integer, _ <OutAttribute> ByRef p_FolderCount As Integer _ ) As Long
public: static long long GetFolderSize( String^ p_Path, [OutAttribute] int% p_FileCount, [OutAttribute] int% p_FolderCount )
The size of the given folder in Bytes.
| Exception | Condition |
|---|---|
| DirectoryNotFoundException | The path is invalid, such as being on an unmapped drive. |
| ArgumentNullException |
p_Path is a null reference |
| SecurityException | The caller does not have the required permission. |