老师,下面代码是注册表的代码,经测试,有一次出现过注册窗口,以后就不再出现了,通过测试,提示第2段和第4段有问题。另外,第三段没有提示,但不出现注册窗口(是我增加的)
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
MessageBox.Show(1)
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
MessageBox.Show(2)
If n > 20 AndAlso Ok = False Then
Messagebox.Show("您正在使用的产品未注册,请注册后使用!")
Forms("注册表").Open()
Syscmd.Project.Exit()
MessageBox.Show(3)
End If
End If
n = n + 1
SaveConfigValue("Count",n)
MessageBox.Show(4)