> ## 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.

# 從遊戲儲存空間刪除 Blob

> 示範如何使用 XblTitleStorageDeleteBlobAsync 從 XBOX 服務遊戲儲存空間刪除 Blob 的 flat C 程式碼範例，並支援雲端存檔的 ETag 比對。

本主題使用下列 flat C 程式碼範例，示範如何從 XBOX 服務遊戲儲存空間刪除 Blob。

#### Flat 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](/zh-TW/reference/system/xasync/structs/xasyncblock)

[XAsyncGetStatus](/zh-TW/reference/system/xasync/functions/xasyncgetstatus)

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


## Related topics

- [遊戲儲存空間範例程式碼](/zh-TW/services/xbox-services/storage/title-storage/how-to/live-title-storage-howto-nav.md)
- [全域儲存空間工具 (GlobalStorage.exe)](/zh-TW/tools/tools-services/live-global-storage-tool.md)
- [操作說明](/zh-TW/services/xbox-services/storage/title-storage/how-to/index.md)
- [從遊戲儲存空間下載 Blob](/zh-TW/services/xbox-services/storage/title-storage/how-to/live-downloading-title-storage-blob.md)
- [取得遊戲儲存空間 Blob 中繼資料](/zh-TW/services/xbox-services/storage/title-storage/how-to/live-getting-title-storage-blob-metadata.md)
