-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathtest.cpp
More file actions
35 lines (32 loc) · 1.4 KB
/
Copy pathtest.cpp
File metadata and controls
35 lines (32 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <iostream>
#include <windows.h>
#include "td.h"
#ifdef _WIN64
#pragma comment(lib,"tdx64.lib")
#else
#pragma comment(lib,"Tdx86.lib")
#endif
//常见问题 验证采用多字节字符集(解决方案-右键-属性-高级-字符集-选择 多字节字符集).
using namespace std;
int main()
{
TD_Init("127.0.0.1", 9002, "1", "天盾");
//TD_SetMacCode("1111111222222");//置机器码,如果有自己的机器码方案可用此命令替换验证自带的取机器码方案
char szBuf[256] = { 0 };
bool bLoginSuccess = TD_CardLogin("ZKDE70D24106H84E49AE9D1570E1A91E", szBuf);
OutputDebugStringV("登录结果1:%s,登录结果2:%s\r\n", bLoginSuccess ? "成功" : "失败", szBuf);
if (bLoginSuccess)
{
for (size_t i = 1; i < 23; i++)
{
OutputDebugStringV("序号%d:%s\r\n", i, TD_GetRetData(i));
}
}
OutputDebugStringV("自定义数据:%s\r\n", TD_GetStaticData());
//OutputDebugStringV("卡号解绑:%s\r\n", TD_UnBindCard("ZK288F511H049D094CB20EAF15F8DF12"));
OutputDebugStringV("JS运算,整数相加,1,2,3 = %s\r\n", TD_RunJs("整数相加,1,2,3"));
OutputDebugStringV("云计算:信息:%s\r\n", TD_Cloud("信息", strlen("信息")));
OutputDebugStringV("云计算:XXX:%s\r\n", TD_Cloud("111222333", strlen("111222333")));
OutputDebugStringV("频率验证:%s\r\n", TD_PingLv() ? "真" : "假");
system("pause");
}