Udostępnij za pośrednictwem


KnownFolders.RequestAccessForUserAsync(User, KnownFolderId) Method

Definition

Requests access for the user and folderId.

public:
 static IAsyncOperation<KnownFoldersAccessStatus> ^ RequestAccessForUserAsync(User ^ user, KnownFolderId folderId);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<KnownFoldersAccessStatus> RequestAccessForUserAsync(User const& user, KnownFolderId const& folderId);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<KnownFoldersAccessStatus> RequestAccessForUserAsync(User user, KnownFolderId folderId);
function requestAccessForUserAsync(user, folderId)
Public Shared Function RequestAccessForUserAsync (user As User, folderId As KnownFolderId) As IAsyncOperation(Of KnownFoldersAccessStatus)

Parameters

user
User

The user property.

folderId
KnownFolderId

The Id of the folder to be returned.

Returns

Returns a KnownFolderAccessStatus enum.

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 method is Multi-User Aware (MUA).

Providing a null User will result in an Invalid argument exception as MUA apps should always provide a valid non-null User.

Applies to

See also