Share via


你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

BlobBaseClient.DownloadContentAsync 方法

定义

重载

DownloadContentAsync()

操作 DownloadContentAsync() 从服务下载 Blob,包括其元数据和属性。

有关详细信息,请参阅 获取 Blob

DownloadContentAsync(CancellationToken)

操作 DownloadContentAsync(CancellationToken) 从服务下载 Blob,包括其元数据和属性。

有关详细信息,请参阅 获取 Blob

DownloadContentAsync(BlobDownloadOptions, CancellationToken)

操作 DownloadContentAsync(BlobDownloadOptions, CancellationToken) 从服务下载 Blob,包括其元数据和属性。

有关详细信息,请参阅 获取 Blob

DownloadContentAsync()

操作 DownloadContentAsync() 从服务下载 Blob,包括其元数据和属性。

有关详细信息,请参阅 获取 Blob

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobDownloadResult>> DownloadContentAsync ();
abstract member DownloadContentAsync : unit -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobDownloadResult>>
override this.DownloadContentAsync : unit -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobDownloadResult>>
Public Overridable Function DownloadContentAsync () As Task(Of Response(Of BlobDownloadResult))

返回

描述 Response<T> 下载的 Blob 的 。 Content 包含 Blob 的数据。

注解

RequestFailedException如果失败,将引发 。

此 API 是提取可放入内存的 Blob 的首选方法。 提供 BinaryData 内容时,为字节的有效负载提供轻量级抽象。 它提供了方便的帮助程序方法来获取常用的基元,例如流、字符串或字节。 请考虑以下替代方法:

  • DownloadToAsyncto 将 Blob 内容流式传输到路径或 Stream
  • 下载StreamingAsync 作为此 API 的替代项。 对于任何高级方案,使用它直接访问网络流。

适用于

DownloadContentAsync(CancellationToken)

操作 DownloadContentAsync(CancellationToken) 从服务下载 Blob,包括其元数据和属性。

有关详细信息,请参阅 获取 Blob

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobDownloadResult>> DownloadContentAsync (System.Threading.CancellationToken cancellationToken);
abstract member DownloadContentAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobDownloadResult>>
override this.DownloadContentAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobDownloadResult>>
Public Overridable Function DownloadContentAsync (cancellationToken As CancellationToken) As Task(Of Response(Of BlobDownloadResult))

参数

cancellationToken
CancellationToken

可选 CancellationToken ,用于传播应取消操作的通知。

返回

描述 Response<T> 下载的 Blob 的 。 Content 包含 Blob 的数据。

注解

RequestFailedException如果失败,将引发 。

此 API 是提取可放入内存的 Blob 的首选方法。 提供 BinaryData 内容时,为字节的有效负载提供轻量级抽象。 它提供了方便的帮助程序方法来获取常用的基元,例如流、字符串或字节。 请考虑以下替代方法:

  • DownloadToAsyncto 将 Blob 内容流式传输到路径或 Stream
  • 下载StreamingAsync 作为此 API 的替代项。 对于任何高级方案,使用它直接访问网络流。

适用于

DownloadContentAsync(BlobDownloadOptions, CancellationToken)

操作 DownloadContentAsync(BlobDownloadOptions, CancellationToken) 从服务下载 Blob,包括其元数据和属性。

有关详细信息,请参阅 获取 Blob

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobDownloadResult>> DownloadContentAsync (Azure.Storage.Blobs.Models.BlobDownloadOptions options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member DownloadContentAsync : Azure.Storage.Blobs.Models.BlobDownloadOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobDownloadResult>>
override this.DownloadContentAsync : Azure.Storage.Blobs.Models.BlobDownloadOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobDownloadResult>>
Public Overridable Function DownloadContentAsync (Optional options As BlobDownloadOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of BlobDownloadResult))

参数

options
BlobDownloadOptions

下载操作的可选参数。

cancellationToken
CancellationToken

可选 CancellationToken ,用于传播应取消操作的通知。

返回

描述 Response<T> 下载的 Blob 的 。 Content 包含 Blob 的数据。

注解

RequestFailedException如果失败,将引发 。

此 API 是提取可放入内存的 Blob 的首选方法。 提供 BinaryData 内容时,为字节的有效负载提供轻量级抽象。 它提供了方便的帮助程序方法来获取常用的基元,例如流、字符串或字节。 请考虑以下替代方法:

  • DownloadToAsyncto 将 Blob 内容流式传输到路径或 Stream
  • 下载StreamingAsync 作为此 API 的替代项。 对于任何高级方案,使用它直接访问网络流。

适用于