帮助中的另一种软件加密,就是利用注册码,代码如下
Dim n As
Integer = GetConfigValue("Count",1)
Dim Code As
String = GetConfigValue("Register" & ComputerId,"")
Dim Ok As
Boolean
If Code > "" AndAlso DecryptText(Code,"abc","abc") = ComputerId Then
'如果注册码正确
OK = True
Else
If n > 30
Then
Forms("注册").Open()
Code = GetConfigValue("Register" & ComputerId,"")
If Code > "" AndAlso DecryptText(Code,"abc","abc") = ComputerId Then
'如果注册码正确
OK = True
End
If
End
If
If n > 60
AndAlso Ok = False
Then
Messagebox.Show("您正在使用的产品已经超出试用次数!")
Syscmd.Project.Exit()
End
If
End
If
n = n + 1
SaveConfigValue("Count",n)
根据用户的使用次数来做限制。这个使用次数是保存在程序项目中。每次使用一次。就会记录到程序中。发布后,记录也没有清零。导至发布后的软件也会有记录。如何解决这个问题