脚本为王 - 注册

4 篇文章 0 订阅
3 篇文章 0 订阅


QQ: 282397369

配置界面

软件还没开做,先搞个注册,不注册不让用。
注册也就是授权。基于使用来说,授权分两个层面:目标计算机可以运行本程序、可以运行指定脚本。
从设计概念来说,脚本对应于一个业务,或模块。
所以先设计配置界面
在这里插入图片描述

目标计算机授权

获取本机序列号

通过绑定MAC地址、硬盘序列号等措施,计算得到本机序列号,用户不可修改。

LabeledEdit_Computer_SN->Text = THelper::Register::GetApplicationGuidCode
		(GuidCharacteristicCode);

申请注册

申请注册,将本机相应信息发送到目标QQ群,由维护人员手工注册,生成相应注册码。

	LabeledEdit_Computer_SN->Text = THelper::Register::GetApplicationGuidCode
		(GuidCharacteristicCode);
	UnicodeString progress =
		THelper::Register::ResponseNode->AttributeValueByName("progress");
	THelper::String::ReplaceStringInStr(progress, L";", L"\n");

	THelper::TqqController::ReportDebug
		(THelper::FormatString(L"请授权本机使用脚本程序:\n本机序列号:%s\n%s",
		LabeledEdit_Computer_SN->Text, progress));

在这里插入图片描述
录入相应注册码后,进行比对,匹配则为已注册
在这里插入图片描述

业务模块授权

不同业务模块,对应于不同的脚本。同样策略,可以针对指定模块进行注册申请与授权操作。

	int index = ListBox_Module->ItemIndex;
	if (index == -1)
		return;
	TScriptModuleConfig * config =
		(TScriptModuleConfig*)(ListBox_Module->Items->Objects[index]);
	LabeledEdit_Computer_SN->Text = THelper::Register::GetApplicationGuidCode
		(GuidCharacteristicCode);
	UnicodeString progress =
		THelper::Register::ResponseNode->AttributeValueByName("progress");
	THelper::String::ReplaceStringInStr(progress, L";", L"\n");
	UnicodeString moduleName = config->Name;

	THelper::TqqController::ReportDebug
		(THelper::FormatString(L"请授权本机使用目标模块:\n本机序列号:%s\n模块名称:%s\n%s",
		LabeledEdit_Computer_SN->Text, moduleName, progress));

在这里插入图片描述
录入授权注册码后,检查比对匹配结果。在这里插入图片描述
开始做收费的美梦。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值