在项目
AfterOpenProject
代码如下:
Dim n As Integer = GetConfigValue("Count",1)
Dim Code As String = GetConfigValue("Register" & ComputerId,"")
If Code > "" AndAlso DecryptText(Code,"1111","2222") = ComputerId Then '如果注册码正确
n = n + 1
SaveConfigValue("Count",n)
Vars("出车时间") = ""
Vars("版本号") = "V10.12.06.01"
Forms("登陆").Open()
Else
If n > 50 And n <= 90 Then
Forms("注册窗口").Open()
Else If n > 90 Then
Messagebox.Show("您正在使用的产品已经超出试用次数!")
Vars("IP") = ""
Syscmd.Project.Exit(False)
End If
End If
注册窗口:
AfterLoad代码如下:
e.Form.Controls("TextBox1").Value = ComputerId
e.Form.Controls("TextBox2").Value = GetConfigValue("Register" & ComputerId, "")
确认按钮代码如下:
Dim Code As String = e.Form.Controls("TextBox2").Value
Dim n As Integer
If Code > "" AndAlso DecryptText(Code,"1111","2222") = ComputerId Then '如果注册码正确
n = n + 1
SaveConfigValue("Count",n)
SaveConfigValue("Register" & ComputerId, e.Form.Controls("TextBox2").Value)
Vars("出车时间") = ""
Vars("版本号") = "V10.12.06.01"
e.Form.Close()
Forms("登陆").Open()
Else
messagebox.show("输入注册码不正确,请重新输入或与软件开发人员联系!")
Return
End If
怎么老是注册成功后,每次登陆项目都会出现注册窗口,需要重新注册才能登陆。
请高手指点,是哪里出了问题?多谢各位啦!!
[此贴子已经被作者于2011-3-18 13:12:14编辑过]