> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SetConfigValue

> IXtfConsoleControlClient::SetConfigValue

# IXtfConsoleControlClient::SetConfigValue

设置指定配置设置的值。

## 语法

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

### 参数

*pszKey*\
类型：LPCWSTR

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

*pszValue*\
类型：LPCWSTR

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

### 返回值

类型：HRESULT

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

## 备注

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

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

## 要求

**头文件：** xtfconsolecontrol.h

**库：** xtfconsolecontrol.lib

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

## 另请参阅

[IXtfConsoleControlClient::GetConfigValue](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/methods/ixtfconsolecontrolclient_getconfigvalue.md)\
[IXtfConsoleControlClient](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/ixtfconsolecontrolclient.md)\
[XtfConsoleControl](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfconsolecontrol/xtfconsolecontrol_members.md)


## Related topics

- [IXtfConsoleControlClient（接口内容）](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/ixtfconsolecontrolclient.md)
- [XNetworkingSetConfigurationSetting](https://docs.xbox.com/zh-CN/reference/networking/xnetworking/functions/xnetworkingsetconfigurationsetting.md)
- [GetConfigValue](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/methods/ixtfconsolecontrolclient_getconfigvalue.md)
- [XNetworkingQueryConfigurationSetting](https://docs.xbox.com/zh-CN/reference/networking/xnetworking/functions/xnetworkingqueryconfigurationsetting.md)
- [Set Title Data](https://docs.xbox.com/api-reference/title-wide-data-management/set-title-data.md)
