Click or drag to resize

IFolderAsyncGetChildrenAsync Method (Boolean)

IT Hit WebDAV Classes Reference
Returns children of this folder.

Namespace:  ITHit.WebDAV.Client
Assembly:  ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 2.0.420.0
Syntax
Task<IHierarchyItemAsync[]> GetChildrenAsync(
	bool recursively
)

Parameters

recursively
Type: SystemBoolean
Indicates if all subtree of children should be returned.

Return Value

Type: TaskIHierarchyItemAsync
Array that include child folders and files.
Exceptions
ExceptionCondition
NotFoundExceptionThis folder doesn't exist on the server.
WebDavHttpExceptionServer returned unknown error.
WebDavExceptionUnexpected error occurred.
Examples
string license = "<?xml version='1.0' encoding='utf...
WebDavSessionAsync session = new WebDavSessionAsync(license);
session.Credentials = new NetworkCredential("User1", "pwd");

IFolderAsync folder = await session.OpenFolderAsync( new Uri("http://server:8080/"));
IHierarchyItemAsync[] children = await folder.GetChildrenAsync(false);
foreach (IHierarchyItemAsync item in children)
{
    Console.WriteLine(item.DisplayName);
    IFileAsync file = (IFileAsync)item;
    if(file!=null)
        Console.WriteLine(file.ContentLength);
}
See Also