pb加密码钥匙

SQLCA.DBMS       =ProfileString("sn2012.ini", "DataBase", "SQLCA.DBMS", "")

SQLCA.Database   = ProfileString("sn2012.ini", "DataBase", "SQLCA.Database", "")

SQLCA.ServerName = ProfileString("sn2012.ini", "DataBase", "SQLCA.ServerName", "")

SQLCA.LogId      = ProfileString("sn2012.ini", "DataBase", "SQLCA.LogId", "")

SQLCA.LogPass      = ProfileString("sn2012.ini", "DataBase", "SQLCA.LogPass", "")

SQLCA.AutoCommit = False

SQLCA.DBParm     = ProfileString("sn2012.ini", "DataBase", "SQLCA.DBParm", "")

string ls_reg_type

ls_reg_type=ProfileString("sn2012.ini", "sys_reg", "reg_type", "")

connect using sqlca;

if sqlca.sqlcode<>0 then

        MessageBox ("提示信息", "不能连接数据库:" + sqlca.sqlerrtext)

else

string disksn

string instr

string outstr

boolean r

string ls

string ls_id

string ls_false_sn

string ls_true_sn

long ll_size

string temp_id

string temp_sn

string computerid

date date1

date date2

int free_date

//读取本机信息

disksn=space(100)

GetDiskSN(0,ref disksn)

computerid=space(16)

GetComputerID(ref computerid, 16)

/**********************试用版插入信息************************/     

//试用注册码

select reg_id,reg_sn into :temp_id,:temp_sn from sys_reg where reg_type=:ls_reg_type;

//判断

if temp_id= "" then

/***********************************/

//试用注册码

ls_id=string(relativedate(today(),30),'YYYYMMDD')

ll_size = b64_size(LenA(disksn),1)

ls_false_sn= Space(ll_size)

b64_des(disksn,ls_false_sn,ls_id,LenA(disksn),1)

/***********************************/

insert into sys_reg (reg_type,reg_id,reg_sn)values(:ls_reg_type,:ls_id,:ls_false_sn);

commit;

open(login_win)

else

ll_size = b64_size(LenA(disksn),1)

ls_false_sn= Space(ll_size)

b64_des(disksn,ls_false_sn,temp_id,LenA(disksn),1)

/***********************************/

//正式注册码

ls_id=temp_id

ll_size = b64_size(LenA(computerid),1)

ls_true_sn= Space(ll_size)

b64_des(computerid,ls_true_sn,ls_id,LenA(computerid),1)

//读取数据库注册信息

/***********************************/

choose case temp_sn

                 case ls_false_sn

                         date1=date(today())

                  date2=date(left(ls_id,4) + '-' + mid(ls_id,5,2) + '-' + right(ls_id,2))

                  free_date=DaysAfter(date1,date2)

             if free_date>0 then

                    messagebox('提示','试用版本还有'+string(free_date)+'')

                     open(login_win)

                        else

                 messagebox('提示','试用期已过!请联系供应商')

                          open(sys_reg)

             end if

             case ls_true_sn

                          open(login_win)

end choose

   

end if

end if

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值