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

# IDStorageFileX::Close

> IDStorageFileX::Close

# IDStorageFileX::Close

關閉檔案。

## 語法

```cpp theme={null}
void Close(  
)  
```

### 參數

此方法沒有參數。

### 傳回值

類型：void

## 備註

此方法會明確關閉檔案，不論對應 `IDStorageFileX` 物件的參考計數為何。

當對應 `IDStorageFileX` 物件的最後一個參考被釋放時，檔案會隱含地關閉。

明確或隱含地關閉檔案都會封鎖，直到所有未完成的 I/O 作業完成為止。

`IDStorageFileX` 物件關閉後，就無法再用於 DirectStorage 要求。

如需詳細資訊，請參閱 [DirectStorage 概觀](/zh-TW/build/console-features/storage/directstorage/directstorage-overview)中的「IDStorageFileX」一節。

## 需求

**標頭：** dstorage\_xs.h

**程式庫：** dstorage\_xs.lib

**支援的平台：** XBOX Series 主機

## 另請參閱

[IDStorageFactoryX::OpenFile](/zh-TW/reference/system/dstorage/interfaces/IDStorageFactoryX/methods/idstoragefactoryx_openfile)\
[IDStorageFileX](/zh-TW/reference/system/dstorage/interfaces/IDStorageFileX/idstoragefilex)


## Related topics

- [IDStorageFileX::Close](/ko/reference/system/dstorage/interfaces/IDStorageFileX/methods/idstoragefilex_close.md)
- [IDStorageFileX](/reference/system/dstorage/interfaces/IDStorageFileX/idstoragefilex.md)
