Udostępnij za pośrednictwem


IFileSystem.DownloadFileAsync Method

Definition

Downloads a remote file if it has not already been downloaded.

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

Parameters

remoteUri
Uri

The URI of the file to download.

progress
IProgress<OperationProgressData>

The interface through which progress is reported.

cancellationToken
CancellationToken

The cancellation token.

Returns

The URI of the local file.

Remarks

If the file system provider for remoteUri does not support IRemoteFileSystemProvider or the remote provider isn't connected to its remote source, no file is downloaded and remoteUri is returned.

Introduced in version FileSystem.

Applies to