GDStorageFileMoveToSecureStorageAsync Method (IStorageFile, IGDStorageFolder, String) |
Namespace: GD
public static IAsyncOperation<GDStorageFile> MoveToSecureStorageAsync( IStorageFile file, IGDStorageFolder destinationFolder, string desiredNewName )
Exception | Condition |
---|---|
Exception | A file with the specified desiredName already exists in the current folder or some unexpected error occurred. |
AccessDeniedException | Secure storage was remotely wiped. |
InvalidArgumentException | The format of the filename is incorrect. Check the value of desiredName. |
When this method completes it tries to zero-out and then delete an original file. If for some reason application could not get write access to file stream it will just copy (not move) the file to secure storage.
This method uses the FailIfExists value from the NameCollisionOption enumeration by default. That is, this method raises an exception if a file with the same name already exists in the destination folder. If you want to handle a file name collision in a different way, call the MoveToSecureStorageAsync(IStorageFile, IGDStorageFolder, String, NameCollisionOption) method.