添加数据库配置项 - SetDbConfigEx
函数简介
保存用户自定义数据到数据库,默认使用 SetConfig 接口配置的数据库,如果未配置则返回失败。
接口名称
SetDbConfigEx
DLL调用
int SetDbConfigEx(long ola, string key, string value);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| ola | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| key | 字符串 | 配置项名,如"width"、"height"。 |
| value | 字符串 | 配置项值,如"100"。 |
示例
C++
long instance = CreateCOLAPlugInterFace();
// 保存配置项
SetDbConfigEx(instance, "username", "admin");
SetDbConfigEx(instance, "width", "1920");
// 读取验证
long ptr = GetDbConfigEx(instance, "username");
char* val = GetStringFromPtr(instance, ptr);
FreeStringPtr(instance, ptr);
Python
# 待补充
返回值
整数型:1 成功,0 失败。
注意事项
- 该函数用于设置用户自定义数据,如账号密码、软件默认配置等信息。
