上传者: lixilun
|
上传时间: 2021-11-17 15:50:33
|
文件大小: 55KB
|
文件类型: -
If Combo.Text = "" Then MsgBox "请选择加密方案", vbExclamation: Exit Sub
'空狗
et99pid = "FFFFFFFF"
et99pin = "FFFFFFFFFFFFFFFF"
retcode = et_FindToken(et99pid, et99count) '查找加密狗
If retcode = 0 Then
retcode = et_OpenToken(et99handle, et99pid, 1) '打开加密狗
retcode = et_Verify(et99handle, 1, et99pin) '验证SOPIN
retcode = et_GenPID(et99handle, LenB(StrConv(et99seed, vbFromUnicode)), et99seed, et99pid) '设置硬件PID
retcode = et_GenSOPIN(et99handle, Len("33102150"), "33102150", et99pin) '修改SOPIN
retcode = et_ChangeUserPIN(et99handle, "FFFFFFFFFFFFFFFF", "1984011219840112") '修改USERPIN
writestr = Format(Date, "YYYY-MM-DD")
writearr = StrConv(writestr, vbFromUnicode)
retcode = et_Write(et99handle, 0, Len(writestr), writearr(0)) '写入日期
retcode = et_CloseToken(et99handle) '关闭加密狗
MsgBox "加密狗设置成功,采用的方案:" & 产品名称, vbInformation
Exit Sub
End If
'已经写过的狗
Call OpenEt99数据表
If Et99数据表.RecordCount <= 0 Then GoTo Er:
For i = 0 To Et99数据表.RecordCount - 1
et99pid = Et99数据表("硬件PID")
retcode = et_FindToken(et99pid, et99count)
If retcode = 0 Then
retcode = et_OpenToken(et99handle, et99pid, 1) '打开加密狗
et99pin = "FFFFFFFFFFFFFFFF" '可以修改成自己的SOPIN
retcode = et_Verify(et99handle, 1, et99pin) '验证SOPIN
If retcode 0 Then
et99pin = "FFFFFFFFFFFFFFFF"
retcode = et_Verify(et99handle, 1, et99pin) '验证SOPIN
If retcode 0 Then GoTo Er:
End If
retcode = et_GenPID(et99handle, LenB(StrConv(et99seed, vbFromUnicode)), et99seed, et99pid) '设置硬件PID
writestr = Format(Date, "YYYY-MM-DD")
writearr = StrConv(writestr, vbFromUnicode)
retcode = et_Write(et99handle, 0, Len(writestr), writearr(0)) '写入日期
retcode = et_CloseToken(et99handle) '关闭加密狗
MsgBox "加密狗设置成功,采用的方案:" & 产品名称, vbInformation
Call CloseEt99数据表
Exit Sub
End If
Et99数据表.MoveNext
Next i
Er:
Call CloseEt99数据表
MsgBox