Click or drag to resize
GDStorageFolderGetFolderAsync Method
Gets the subfolder with the specified name from the current folder.

Namespace:  GD
Assembly:  GD (in GD.dll) Version: 255.255.255.255
Syntax
public IAsyncOperation<GDStorageFolder> GetFolderAsync(
	string name
)

Parameters

name
Type: SystemString
The name (or path relative to the current folder) of the subfolder to get.

Return Value

Type: IAsyncOperationGDStorageFolder
When this method completes successfully, it returns a GDStorageFolder that represents the specified subfolder.

Implements

IGDStorageFolderGetFolderAsync(String)
Exceptions
ExceptionCondition
Exception(C# equivalent: System.IO.FileNotFoundException) The specified folder does not exist. Check the value of name.
AccessDeniedException(C# equivalent: System.UnauthorizedAccessException) Secure storage was remotely wiped.
InvalidArgumentException(C# equivalent: System.ArgumentException) The path contains invalid characters, or the format of the path is incorrect. Check the value of name.
Remarks
To get an item that's a file or a folder, call the GetItemAsync(String) method.
Examples
The following example shows how to get a subfolder from the current folder by calling the GetFolderAsync(String) method. This example also shows how to get a subfolder from a subfolder of the current folder by providing a relative path.
using GD;

// Get root folder of GD secure storage
GDStorageFolder rootFolder = GDWindows.Instance.SecureFolder;

// Create 2 levels of subfolders in the app's local folder.
GDStorageFolder subFolder1 = await rootFolder.CreateFolderAsync("Subfolder1");
GDStorageFolder subFolder2 = await subFolder1.CreateFolderAsync("Subfolder2");

// Get the subfolder
GDStorageFolder level1Folder = await rootFolder.GetFolderAsync("Subfolder1");

// Get the subfolder of the subfolder by providing a relative path.
GDStorageFolder level2Folder = await rootFolder.GetFolderAsync(@"Subfolder1\Subfolder2");
See Also