一个软件注册程序我在 AfterOpenProject 事件中写了一下代码:我该怎么同时判断注册表中的值呀?
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 > 5 Then
Forms("注册窗体").Open()
Code = GetConfigValue("Register" & ComputerId,"")
If Code > "" AndAlso DecryptText(Code,"abc","abc") = ComputerId Then '如果注册码正确
OK = True
End If
End If
If n >10 AndAlso Ok = False Then
Messagebox.Show("您正在使用的产品已经超出试用次数!")
Syscmd.Project.Exit()
End If
End If
n = n + 1
SaveConfigValue("Count",n)
Dim
Count As Integer
Count = Registry.GetValue("HKEY_CURRENT_USER\Software\MyApp","Count",0)
Registry.SetValue("HKEY_CURRENT_USER\Software\MyApp","Count",Count + 1)
Output.Show(Count)