GetDirectoryContentSizeAsync(string path, bool recursive, System.Threading.CancellationToken cancellationToken) Method

Returns the total number of bytes contained in the specified directory.

Syntax

public virtual Task<long?> GetDirectoryContentSizeAsync(string path, bool recursive, System.Threading.CancellationToken cancellationToken)

Parameters

path
Type: string

Path to the directory.

recursive
Type: bool

Value indicating whether to include subdirectories.

cancellationToken
Type: System.Threading.CancellationToken

Token used to cancel asynchronous operation.

Returns

Total number of bytes contained in the directory, or null (Nothing in Visual Basic) if the information is not available.