KnownFolders.GetFolderAsync(KnownFolderId) Method

Definition

Retrieves the folder for the folderId specified.

public:
 static IAsyncOperation<StorageFolder ^> ^ GetFolderAsync(KnownFolderId folderId);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<StorageFolder> GetFolderAsync(KnownFolderId const& folderId);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<StorageFolder> GetFolderAsync(KnownFolderId folderId);
function getFolderAsync(folderId)
Public Shared Function GetFolderAsync (folderId As KnownFolderId) As IAsyncOperation(Of StorageFolder)

Parameters

folderId
KnownFolderId

The Id of the folder to be returned.

Returns

When this method completes, it returns the requested StorageFolder object.

Attributes

Windows requirements

Device family
Windows 10, version 2004 (introduced in 10.0.19041.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v10.0)

Remarks

This is a Single User Aware (SUA) method.

If the app does not have access because it isn’t manifested with the required capability, the user denied access from a prompt or the settings page, or a system administrator has disabled access, then this call will fail with access denied.

Applies to

See also