共用方式為


IFileSystemProvider.DeleteAsync Method

Definition

Deletes a file or directory.

public:
 System::Threading::Tasks::Task ^ DeleteAsync(Uri ^ uri, bool recursive, IProgress<Microsoft::VisualStudio::RpcContracts::FileSystem::OperationProgressData> ^ progress, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task DeleteAsync (Uri uri, bool recursive, IProgress<Microsoft.VisualStudio.RpcContracts.FileSystem.OperationProgressData>? progress, System.Threading.CancellationToken cancellationToken);
abstract member DeleteAsync : Uri * bool * IProgress<Microsoft.VisualStudio.RpcContracts.FileSystem.OperationProgressData> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function DeleteAsync (uri As Uri, recursive As Boolean, progress As IProgress(Of OperationProgressData), cancellationToken As CancellationToken) As Task

Parameters

uri
Uri

The file or directory to delete.

recursive
Boolean

True to remove directories, subdirectories, and files in uri; otherwise false. If uri refers to a file, recursive is ignored.

progress
IProgress<OperationProgressData>

The interface through which progress is reported.

cancellationToken
CancellationToken

The cancellation token.

Returns

A task representing the asynchronous delete operation.

Exceptions

uri is null.

uri refers to a directory that is not empty and recursive is false.

Applies to