GDStorageFolderCreateFolderAsync Method (String, CreationCollisionOption) |
Namespace: GD
public IAsyncOperation<GDStorageFolder> CreateFolderAsync( string desiredName, CreationCollisionOption options )
Exception | Condition |
---|---|
Exception | You specified FailIfExists and a subfolder with the specified desiredName already exists in the current folder or some unexpected error occurred. |
AccessDeniedException | Secure storage was remotely wiped or options was specified as OpenIfExists or ReplaceExisting and file with same name as desiredName already exists. |
InvalidArgumentException | The folder name contains invalid characters, or the format of the folder name is incorrect. Check the value of desiredName or unsupported value of options was given. |
If a folder with the specified desiredName already exists in the current folder, the specified CreationCollisionOption determines how to handle the collision.
If you try to create a subfolder in a folder that represents a container for a group of files (for example, the return value from some overloads of the GetFoldersAsync method), the CreateFolderAsync(String, CreationCollisionOption) method may fail.
Note: No leading nor trailing spaces are stripped from desiredName.
using GD; var secureSubfolder = await GDWindows.Instance.SecureFolder.CreateFolderAsync("SubFolder", CreationCollisionOption.FailIfExists);