Dim n As Integer = GetConfigValue("Count",1)
Dim Code As String = GetConfigValue("Register" & ComputerId,"")
Dim Ok As Boolean
try
If n = 1 Then
Forms("首次注册").Open()
Code = GetConfigValue("Register" & ComputerId,"")
If Code > "" AndAlso DecryptText(Code,"bcd","bcd") = ComputerId Then '如果注册码正确
Messagebox.Show("注册成功!")
OK = True
SaveConfigValue("Count",2)
Else
SaveConfigValue("Count",1)
Messagebox.Show("首未注册不能进入!")
Syscmd.Project.Exit()
End If
Else
If Code > "" AndAlso DecryptText(Code,"abc","abc") = ComputerId Then '如果注册码正确
OK = True
Else
ok = False
End If
If OK = False Then
If n > 25 Then
Forms("限次注册").Open()
Code = GetConfigValue("Register" & ComputerId,"")
If Code > "" AndAlso DecryptText(Code,"abc","abc") = ComputerId Then '如果注册码正确
Messagebox.Show("注册成功!")
OK = True
Else
Messagebox.Show("限次注册码不正确!")
End If
End If
If n >35 AndAlso Ok = False Then
Messagebox.Show("使用次数已过,请注册!")
Syscmd.Project.Exit()
End If
End If
n = n + 1
SaveConfigValue("Count",n)
End If
catch ex As exception
msgbox("注册码不正确") 如果注册码不正确,就退出项目,没有机会再机会再输入正确注册码
'Syscmd.Project.Exit()
End try