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

# IXtfConsoleControlClient::SetConfigValue

> IXtfConsoleControlClient::SetConfigValue

# IXtfConsoleControlClient::SetConfigValue

设置指定配置设置的值。

<a id="syntaxSection" />

## 语法

```cpp theme={null}
HRESULT SetConfigValue(
         LPCWSTR pszKey,
         LPCWSTR pszValue
)  
```

<a id="parametersSection" />

### 参数

*pszKey*\
类型：LPCWSTR

指向要设置其值的配置设置名称的指针。

*pszValue*\
类型：LPCWSTR

指向要为 *pszKey* 中指定的配置设置设定的值的指针。

<a id="retvalSection" />

### 返回值

类型：HRESULT

如果成功，则返回 `S_OK`；否则返回 HRESULT 错误代码。

<a id="remarksSection" />

## 备注

此函数为当前开发主机设置单个配置设置的值。如果 `pszKey` 设置为包含配置设置的有效名称（或键）的字符串指针，则函数返回 `S_OK`，并将该配置设置的值设为 `pszValue` 中指定的指针所指向的字符串。否则，函数返回错误。

有关使用 XBOX Tools Framework (XTF) 访问配置设置的详细信息，请参阅 [配置 (xbconfig.exe) (NDA 主题)](/tools/tools-console/commandlinetools/xbconfig)。

<a id="requirementsSection" />

## 要求

**头文件：** xtfconsolecontrol.h

**库：** xtfconsolecontrol.lib

**支持的平台：** Windows（适用于 XBOX 主机工具）

<a id="seealsoSection" />

## 另请参阅

[IXtfConsoleControlClient::GetConfigValue](/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/methods/ixtfconsolecontrolclient_getconfigvalue)\
[IXtfConsoleControlClient](/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/ixtfconsolecontrolclient)\
[XtfConsoleControl](/reference/tools/xtf/xtfconsolecontrol/xtfconsolecontrol_members)
