'使用注册语句
Dim url As String = "http://foxtable.sinaapp.com/time/?f=Y-m-d"
Dim web As New System.Windows.Forms.WebBrowser()
web.Navigate(url)
Do Until web.ReadyState = 4
Application.DoEvents
Loop
web.Refresh
Dim data As String = web.Document.Body.InnerText ' 日期对比
Dim Count5 As Integer '将数据写入到注册表中
Count5 = Registry.GetValue("HKEY_CURRENT_USER\Software\MyApp","Count5",0)
Registry.SetValue("HKEY_CURRENT_USER\Software\MyApp","Count5",Count5 + 1) '注册表
Dim a As Integer = GetConfigValue("Count1",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 a > 1100 Or Count5>1100 Or data>"2015-09-30" Then '
Forms("注册").Open()
Code = GetConfigValue("Register" & ComputerId,"")
If Code > "" AndAlso DecryptText(Code,"abc","abc") = ComputerId Then '如果注册码正确
OK = True
End If
End If
If a > 1102 Or Count5>1102 Or data>"2015-09-30" AndAlso Ok = False Then
Messagebox.Show("您正在使用的产品已经超期!")
Syscmd.Project.Exit()
End If
End If
a = a + 1
SaveConfigValue("Count1",a)
在项目管理中通过上述代码,弹出模式对话框,要求发布项目到期后进行注册使用,但是,程序实现后发现,弹出模式对话框后,不用注册,只要关掉弹出的注册对话框即可进入系统。
请问,代码应该如何修改,能够在注册码不对的情况下,发布项目自动退出,不能进入工作界面。