Dim n As Integer = Registry.GetValue("HKEY_CURRENT_USER\Software\MyApp","Count",1)
Dim Code As String =Registry.GetValue("HKEY_CURRENT_USER\Software\MyApp","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 = Registry.GetValue("HKEY_CURRENT_USER\Software\MyApp","Register" & ComputerId,"")
If Code > "" AndAlso DecryptText(Code,"abc","abc") = ComputerId Then '如果注册码正确
OK = True
End If
End If
If n > 20 AndAlso Ok = False Then
Messagebox.Show("您正在使用的产品已经超出试用次数!")
Syscmd.Project.Exit()
End If
End If
Registry.SetValue("HKEY_CURRENT_USER\Software\MyApp","count",n + 1)
dim str as string = computerId
Dim zcm As String = EncryptText(str & "|" & new Date(2016,9,1), "abc", "abc")
output.show(zcm)
Dim s As String = DecryptText(zcm, "abc", "abc")
output.show(s)
msgbox(s.split("|")(1))