注册码保存在什么地方更安全。下面的代码,注册码是保存在注册表里。简单的修改一下注册表,即可继续使用软件。有没有其它办法双重保护,让其修改注册表也没用呢
'软件注册代码开始
Dim n As Integer = Registry.GetValue("HKEY_CURRENT_USER\Software\MyAPP","Count",0)
Dim Code As String =Registry.GetValue("HKEY_CURRENT_USER\Software\MyAPP","Register" & HardDiskID,"")
Dim Ok As Boolean
If Code > "" AndAlso DecryptText(Code,"acb","abc") = HardDiskID Then '如果注册码正确
OK = True
Else
If n < 50 Or n=50 Then
Forms("注册").Open()
Code = Registry.GetValue("HKEY_CURRENT_USER\Software\MyAPP","Register" & HardDiskID,"")
If Code > "" AndAlso DecryptText(Code,"abc","abc") = HardDiskID Then '如果注册码正确
OK = True
End If
ElseIf n > 100 AndAlso Ok = False Then
Dim Result As DialogResult
Result = MessageBox.Show("您使用的软件已经超过使用次数,需要注册才能使用,是否注册?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes Then
Forms("注册").Open()
Code = Registry.GetValue("HKEY_CURRENT_USER\Software\MyAPP","Register" & HardDiskID,"")
If Code > "" AndAlso DecryptText(Code,"abc","abc") = HardDiskID Then '如果注册码正确
OK = True
End If
Else
Syscmd.Project.Exit()
End If
End If
End If
Registry.SetValue("HKEY_CURRENT_USER\Software\MyAPP","Count",n + 1)
'软件注册代码结束
[此贴子已经被作者于2017/5/19 10:44:40编辑过]