> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 从 Title Storage 删除 blob

> 扁平 C 代码示例，演示如何使用 XblTitleStorageDeleteBlobAsync 从 XBOX 服务 Title Storage 中删除 blob，并支持 ETag 匹配以用于云存档。

本主题通过以下扁平 C 代码示例演示如何从 XBOX 服务 Title Storage 中删除 blob。

#### 扁平 C

```cpp theme={null}
auto asyncBlock = std::make_unique<XAsyncBlock>();
asyncBlock->queue = queue;
asyncBlock->context = nullptr;
asyncBlock->callback = [](XAsyncBlock* asyncBlock)
{
    std::unique_ptr<XAsyncBlock> asyncBlockPtr{ asyncBlock };    // Take over ownership of XAsyncBlock*.
    HRESULT hr = XAsyncGetStatus(asyncBlock, false);
};

HRESULT hr = XblTitleStorageDeleteBlobAsync(
    xboxLiveContext,
    blobMetadata,
    deleteOnlyIfEtagMatches,
    asyncBlock.get()
);

if (SUCCEEDED(hr))
{
    // The call succeeded, so release the std::unique_ptr ownership
    // of XAsyncBlock* because the callback now takes ownership.
    // If the call fails, std::unique_ptr maintains ownership and deletes XAsyncBlock*.
    asyncBlock.release();
}
```

## 另请参阅

[XAsyncBlock](/reference/system/xasync/structs/xasyncblock)

[XAsyncGetStatus](/reference/system/xasync/functions/xasyncgetstatus)

[XblTitleStorageDeleteBlobAsync](/reference/live/xsapi-c/title_storage_c/functions/xbltitlestoragedeleteblobasync)


## Related topics

- [Title Storage 示例代码](/zh-CN/services/xbox-services/storage/title-storage/how-to/live-title-storage-howto-nav.md)
- [从 Title Storage 下载 blob](/zh-CN/services/xbox-services/storage/title-storage/how-to/live-downloading-title-storage-blob.md)
- [XblTitleStorageDeleteBlobAsync](/zh-CN/reference/live/xsapi-c/title_storage_c/functions/xbltitlestoragedeleteblobasync.md)
- [获取 Title Storage blob 元数据](/zh-CN/services/xbox-services/storage/title-storage/how-to/live-getting-title-storage-blob-metadata.md)
- [将 blob 上传到 Title Storage](/zh-CN/services/xbox-services/storage/title-storage/how-to/live-uploading-title-storage-blob.md)
