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

# IXtfFileIOClient::DeleteFiles 方法

> IXtfFileIOClient::DeleteFiles 方法

# IXtfFileIOClient::DeleteFiles 方法

從開發主機刪除檔案。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
public:
HRESULT DeleteFiles(
         LPCWSTR pszSearchPattern,
         DWORD dwIncludeAttributes,
         DWORD dwExcludeAttributes,
         DWORD dwRecursionLevels,
         DWORD dwFlags,
         IXtfFindFileCallback *pCallback
)  
```

<a id="ID4EH" />

### 參數

*pszSearchPattern*\
類型：LPCWSTR

指向搜尋模式的指標，此模式定義要刪除之檔案的檔案名稱。\
此參數接受萬用字元，以比對符合所指定模式的字串。

*dwIncludeAttributes*\
類型：DWORD

要納入刪除作業之檔案屬性的位元 OR 組合。如需可能的屬性清單，請參閱[檔案屬性常數](https://msdn.microsoft.com/library/windows/desktop/gg258117\(v=vs.85\).aspx)。

*dwExcludeAttributes*\
類型：DWORD

要從刪除作業中排除之檔案屬性的位元 OR 組合。如需可能的屬性清單，請參閱[檔案屬性常數](https://msdn.microsoft.com/library/windows/desktop/gg258117\(v=vs.85\).aspx)。

*dwRecursionLevels*\
類型：DWORD

刪除作業要遞迴的目錄層級數目。

*dwFlags*\
類型：DWORD

指定如何刪除檔案的旗標。這是下表所列巨集的位元 OR 組合。

| 值 | 巨集 | 描述 |
| - | - | - |
| 0x80000000 | XTFDELETEFILE\_DEFER | 延遲檔案刪除。 |

*pCallback*\
類型：IXtfFindFileCallback \*

指向 [IXtfFindFileCallback](/zh-TW/reference/tools/xtf/xtffileio/classes/IXtfFindFileCallback/ixtffindfilecallback-xtffileio-xbox-microsoft-t) 回呼的指標，找到要刪除的檔案時就會呼叫此回呼。

<a id="ID4EQ" />

### 傳回值

類型：HRESULT

HRESULT 成功或錯誤碼。

<a id="requirements" />

## 備註

刪除檔案時，*dwIncludeAttributes* 和 *dwExcludeAttributes* 可作為篩選要刪除哪些檔案的條件，而非用來篩選刪除檔案時要刪除哪些檔案屬性。每刪除一個檔案，就會呼叫 [IXtfFindFileCallback](/zh-TW/reference/tools/xtf/xtffileio/classes/IXtfFindFileCallback/ixtffindfilecallback-xtffileio-xbox-microsoft-t) 的 **onfindfile** 函式。回呼函式會傳回每個要刪除之檔案的相關資訊。傳回的資訊可用來回報刪除作業的進度資訊。

## 需求

**標頭：** xtffileio.h

**程式庫：** xtffileio.lib

**支援的平台：** Windows (適用於 XBOX 主機工具)

<a id="ID4EPC" />

## 另請參閱

<a id="ID4ERC" />

[IXtfFileIOClient 介面](/zh-TW/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/ixtffileioclient-xtffileio-xbox-microsoft-t)\
[XtfFileIO](/zh-TW/reference/tools/xtf/xtffileio/xtffileio-xbox-microsoft-n)\
[IXtfFindFileCallback](/zh-TW/reference/tools/xtf/xtffileio/classes/IXtfFindFileCallback/ixtffindfilecallback-xtffileio-xbox-microsoft-t)


## Related topics

- [IXtfFileIOClient::DeleteFiles Method](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/deletefiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::DeleteFiles (método)](/es/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/deletefiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::DeleteFiles 메서드](/ko/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/deletefiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::DeleteFiles メソッド](/ja-jp/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/deletefiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::RemoveDirectory Method](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/removedirectory-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
