Udostępnij za pośrednictwem


DownloadsFolder.CreateFolderForUserAsync Method

Definition

Overloads

CreateFolderForUserAsync(User, String)

Creates a new subfolder inside the Downloads folder of a specific User.

CreateFolderForUserAsync(User, String, CreationCollisionOption)

Creates a new subfolder in the Downloads folder of a specific User, and specifies what to do if a subfolder with the same name already exists in the Downloads folder.

CreateFolderForUserAsync(User, String)

Creates a new subfolder inside the Downloads folder of a specific User.

public:
 static IAsyncOperation<StorageFolder ^> ^ CreateFolderForUserAsync(User ^ user, Platform::String ^ desiredName);
/// [Windows.Foundation.Metadata.Overload("CreateFolderForUserAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<StorageFolder> CreateFolderForUserAsync(User const& user, winrt::hstring const& desiredName);
[Windows.Foundation.Metadata.Overload("CreateFolderForUserAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<StorageFolder> CreateFolderForUserAsync(User user, string desiredName);
function createFolderForUserAsync(user, desiredName)
Public Shared Function CreateFolderForUserAsync (user As User, desiredName As String) As IAsyncOperation(Of StorageFolder)

Parameters

user
User

The User for which the folder is created.

desiredName
String

Platform::String

winrt::hstring

The desired name of the subfolder to create.

If a subfolder with the specified name already exists, a similar but unique name will be used. For example, if desiredName is "MyFolder" and a subfolder by that name already exists in the Downloads folder, the new subfolder will be created with a name like "MyFolder (1)" instead.

Returns

When this method completes, it returns the new subfolder as a StorageFolder.

Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v2.0)

See also

Applies to

CreateFolderForUserAsync(User, String, CreationCollisionOption)

Creates a new subfolder in the Downloads folder of a specific User, and specifies what to do if a subfolder with the same name already exists in the Downloads folder.

public:
 static IAsyncOperation<StorageFolder ^> ^ CreateFolderForUserAsync(User ^ user, Platform::String ^ desiredName, CreationCollisionOption option);
/// [Windows.Foundation.Metadata.Overload("CreateFolderForUserWithCollisionOptionAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<StorageFolder> CreateFolderForUserAsync(User const& user, winrt::hstring const& desiredName, CreationCollisionOption const& option);
[Windows.Foundation.Metadata.Overload("CreateFolderForUserWithCollisionOptionAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<StorageFolder> CreateFolderForUserAsync(User user, string desiredName, CreationCollisionOption option);
function createFolderForUserAsync(user, desiredName, option)
Public Shared Function CreateFolderForUserAsync (user As User, desiredName As String, option As CreationCollisionOption) As IAsyncOperation(Of StorageFolder)

Parameters

user
User

The User for which the folder is created.

desiredName
String

Platform::String

winrt::hstring

The desired name of the subfolder to create.

If there is an existing subfolder in the Downloads folder that already has the specified desiredName, the specified CreationCollisionOption determines how Windows responds to the conflict.

option
CreationCollisionOption

The enum value that determines how Windows responds if the desiredName is the same as the name of an existing subfolder in the Downloads folder.

Because the app can only access folders in the Downloads folder of the specified User, you can't specify OpenIfExists or ReplaceExisting for this parameter.

Returns

When this method completes, it returns the new subfolder as a StorageFolder.

Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v2.0)

See also

Applies to