Skip to content

按激活码解绑 - UnBindEx ​

函数简介 ​

解绑指定激活码的单独授权。同机上的普通授权和其他激活码授权保持不变。

若当前进程是用 LoginEx 登录的,调用 UnBind 也会改走本接口,并使用这次登录的激活码。解绑成功后,定时心跳不再继续请求 LoginEx。

换机、且新设备还没有这条授权时,仍使用 强制解绑 - ForceUnBind。

返回数据格式:

json
{
  "Code": 1,
  "ServerTime": "2026-04-24 10:00:00.000",
  "Message": "",
  "LicenseKey": "XXXX-XXXX"
}
字段名说明
Code1 成功,0 失败。
ServerTime服务器时间。
Message提示信息;失败时多为 错误码:中文描述。完整对照见 客户端错误码说明。
LicenseKey本次解绑的激活码。

常见错误码(Message 字段) ​

Message含义
2003:参数无效未传激活码
2004:用户不存在用户不存在
2015:未找到可解绑设备授权当前机器上没有这张激活码的单独授权
2016:试用授权不支持解绑试用授权禁止解绑

接口名称 ​

UnBindEx

DLL调用 ​

long UnBindEx(string userCode, string softCode, string softVersion, string dealerCode, string licenseKey);

参数说明 ​

参数名类型说明
userCode字符串用户码。
softCode字符串软件码。
softVersion字符串软件版本。
dealerCode字符串经销商码。
licenseKey字符串要解绑的激活码。必填。

示例 ​

SDK 调用 ​

cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
OlaAuthUnbindReturn result = ola.UnBindEx("userCode", "softCode", "1.0.0", "dealerCode", "XXXX-XXXX");
// result.Code == 1 表示这一张激活码已解绑
csharp
using OLAPlug;

var ola = new OLAPlugServer();
OlaAuthUnbindReturn result = ola.UnBindEx("userCode", "softCode", "1.0.0", "dealerCode", "XXXX-XXXX");
python
from OLAPlugServer import OLAPlugServer

ola = OLAPlugServer()
json_result = ola.UnBindEx("userCode", "softCode", "1.0.0", "dealerCode", "XXXX-XXXX")

原生 DLL 调用 ​

cpp
long resultPtr = UnBindEx("userCode", "softCode", "1.0.0", "dealerCode", "XXXX-XXXX");
if (resultPtr != 0) {
    char result[512] = {0};
    GetStringFromPtr(resultPtr, result, sizeof(result));
    FreeStringPtr(resultPtr);
}

返回值 ​

调用方式返回值说明
SDKOlaAuthUnbindReturnCode == 1 表示解绑成功
原生 DLL非 0成功,返回 JSON 字符串
原生 DLL0失败

注意事项 ​

项目说明
作用范围只结束这一张激活码。普通设备授权和其他激活码授权不受影响。
定时任务若解绑的就是当前 LoginEx 会话的激活码,之后的心跳改走 Login。
释放内存返回的字符串指针需要调用 FreeStringPtr。

相关接口 ​