StorageFolder.CreateFolderAsync(String, CreationCollisionOption) | createFolderAsync(String, CreationCollisionOption) method

Applies to Windows and Windows Phone

Creates a new sub-folder inside the current folder, and specifies what to do if a folder with the same name already exists in the current folder.

Syntax


public:
IAsyncOperation<StorageFolder>^ CreateFolderAsync(
  String^ desiredName, 
  CreationCollisionOption options
)

Parameters

desiredName

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The desired name of the new subfolder to create.

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

options

Type: CreationCollisionOption

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

Return value

Type: IAsyncOperation<StorageFolder>

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

Remarks

If you try to create a subfolder in a virtual folder like a library or a file group, this method may fail.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

Windows.Storage
Windows::Storage [C++]

Metadata

Windows.winmd

See also

StorageFolder
CreateFolderAsync(String)

 

 

Show:
© 2014 Microsoft