IStorageFolder.CreateFileAsync Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
CreateFileAsync(String) |
Creates a new file in the current folder. |
CreateFileAsync(String, CreationCollisionOption) |
Creates a new file in the current folder, and specifies what to do if a file with the same name already exists in the current folder. |
Creates a new file in the current folder.
public:
IAsyncOperation<StorageFile ^> ^ CreateFileAsync(Platform::String ^ desiredName);
/// [Windows.Foundation.Metadata.Overload("CreateFileAsyncOverloadDefaultOptions")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<StorageFile> CreateFileAsync(winrt::hstring const& desiredName);
[Windows.Foundation.Metadata.Overload("CreateFileAsyncOverloadDefaultOptions")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<StorageFile> CreateFileAsync(string desiredName);
function createFileAsync(desiredName)
Public Function CreateFileAsync (desiredName As String) As IAsyncOperation(Of StorageFile)
Parameters
- desiredName
-
String
Platform::String
winrt::hstring
The desired name of the file to create.
Returns
When this method completes, it returns the new file as a StorageFile.
- Attributes
See also
Applies to
WinRT Build 26100 and other versions
Product | Versions |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |
Creates a new file in the current folder, and specifies what to do if a file with the same name already exists in the current folder.
public:
IAsyncOperation<StorageFile ^> ^ CreateFileAsync(Platform::String ^ desiredName, CreationCollisionOption options);
/// [Windows.Foundation.Metadata.Overload("CreateFileAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<StorageFile> CreateFileAsync(winrt::hstring const& desiredName, CreationCollisionOption const& options);
[Windows.Foundation.Metadata.Overload("CreateFileAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<StorageFile> CreateFileAsync(string desiredName, CreationCollisionOption options);
function createFileAsync(desiredName, options)
Public Function CreateFileAsync (desiredName As String, options As CreationCollisionOption) As IAsyncOperation(Of StorageFile)
Parameters
- desiredName
-
String
Platform::String
winrt::hstring
The desired name of the file to create.
If there is an existing file in the current folder that already has the specified desiredName, the specified CreationCollisionOption determines how Windows responds to the conflict.
- options
- CreationCollisionOption
The enum value that determines how Windows responds if the desiredName is the same as the name of an existing file in the current folder.
Returns
When this method completes, it returns the new file as a StorageFile.
- Attributes
See also
Applies to
WinRT Build 26100 and other versions
Product | Versions |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |