GameSaveContainer.ReadAsync(IMapView<String,IBuffer>) 方法

定义

从此容器中读取 blobsToRead 指定的 blob。 在 blobsToRead 中传递的缓冲区必须足够大,才能存储 Blob 数据。

public:
 virtual IAsyncOperation<GameSaveOperationResult ^> ^ ReadAsync(IMapView<Platform::String ^, IBuffer ^> ^ blobsToWrite) = ReadAsync;
public:
 virtual IAsyncOperation<GameSaveOperationResult ^> ^ ReadAsync(IMapView<Platform::String ^, IBuffer ^> ^ blobsToRead) = ReadAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<GameSaveOperationResult> ReadAsync(IMapView<winrt::hstring, IBuffer const&> const& blobsToWrite);
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<GameSaveOperationResult> ReadAsync(IMapView<winrt::hstring, IBuffer const&> const& blobsToRead);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<GameSaveOperationResult> ReadAsync(IReadOnlyDictionary<string,IBuffer> blobsToWrite);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<GameSaveOperationResult> ReadAsync(IReadOnlyDictionary<string,IBuffer> blobsToRead);
function readAsync(blobsToWrite)
function readAsync(blobsToRead)
Public Function ReadAsync (blobsToWrite As IReadOnlyDictionary(Of String, IBuffer)) As IAsyncOperation(Of GameSaveOperationResult)
Public Function ReadAsync (blobsToRead As IReadOnlyDictionary(Of String, IBuffer)) As IAsyncOperation(Of GameSaveOperationResult)

参数

blobsToWriteblobsToRead

IMapView<String,IBuffer>

IReadOnlyDictionary<String,IBuffer>

IMapView<Platform::String,IBuffer>

IMapView<winrt::hstring,IBuffer>

返回

类型: IAsyncOperation<;GameSaveOperationResult>;

IAsyncOperation<;GameSaveOperationResult>; 表示异步操作的状态。

属性

注解

使用 GameSaveBlobInfoQuery 确定请求的每个游戏保存 blob 所需的缓冲区大小。

如果操作成功完成,则返回的缓冲区的 length 属性将指定每个缓冲区中包含的数据量。

ReadAsyncGetAsync 的不同之处在于 ,GetAsync 会自动为 Blob 数据分配所需的缓冲区,并在 GameSaveBlobGetResult 对象中返回该数据。 ReadAsync 而是直接写入 blobsToRead 参数中传递的缓冲区。

异步操作完成后,检查结果的 Status 属性,以确定操作是否成功与 GameSaveErrorStatus.Ok。

适用于

另请参阅