> ## 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::GetFileAttributes 方法

> IXtfFileIOClient::GetFileAttributes 方法

# IXtfFileIOClient::GetFileAttributes 方法

擷取開發主機上指定檔案的屬性。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
public:
HRESULT GetFileAttributes(
         LPCWSTR pszFileName,
         LPDWORD pdwFileAttributes
)  
```

<a id="parametersSection" />

### 參數

*pszFileName*\
類型：LPCWSTR

\[in] 指向要取得其屬性之檔案的檔案名稱指標。

*pdwFileAttributes*\
類型：LPDWORD

\[out] 接收指定檔案之檔案屬性位元 OR 組合的指標。如需可能的屬性清單，請參閱[檔案屬性常數](https://msdn.microsoft.com/library/windows/desktop/gg258117\(v=vs.85\).aspx)。

<a id="retvalSection" />

### 傳回值

類型：HRESULT

如果成功，則傳回 `S_OK`；否則傳回 HRESULT 錯誤碼。

<a id="remarksSection" />

## 備註

此函式會取得開發主機上指定檔案的檔案屬性。如果發生錯誤，此函式會傳回 HRESULT 錯誤碼。如需 XBOX Tools Framework (XTF) API 特有之 HRESULT 錯誤碼的詳細資訊，請參閱 [XTF 傳輸錯誤 (NDA 主題)](/zh-TW/tools/tools-console/commandlinetools/xtf-transport-errors)。

使用 [IXtfFileIOClient::SetFileAttributes](/zh-TW/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/setfileattributes-ixtffileioclient-xtffileio-xbox-microsoft-m) 方法來設定開發主機上指定檔案的檔案屬性。

<a id="requirementsSection" />

## 需求

**標頭：** xtffileio.h

**程式庫：** xtffileio.lib

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

<a id="seealsoSection" />

## 另請參閱

[IXtfFileIOClient::GetFileInfo](/zh-TW/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/getfileinfo-ixtffileioclient-xtffileio-xbox-microsoft-m)\
[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)


## Related topics

- [IXtfFileIOClient::SetFileAttributes Method](/zh-CN/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/setfileattributes-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::GetFileAttributes Method](/zh-CN/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/getfileattributes-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::GetFileAttributes (método)](/es/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/getfileattributes-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::GetFileAttributes 메서드](/ko/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/getfileattributes-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::GetFileAttributes メソッド](/ja-jp/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/getfileattributes-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
