以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  注册例子中AfterOpenProject事件代码问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=7289)

--  作者:i52117
--  发布时间:2010/6/4 13:49:00
--  注册例子中AfterOpenProject事件代码问题

4、最后将项目的AfterOpenProject事件设为:

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
Else
    If
n > 30 Then
        Forms(
"注册").Open()
        Code = GetConfigValue(
"Register" & ComputerId,"")
        If
Code > "" AndAlso DecryptText(Code,"abc","abc") = ComputerId Then \'如果注册码正确
            OK =
True
        End
If
    End
If
    If
n > 60 AndAlso Ok = False Then
        Messagebox.Show(
"您正在使用的产品已经超出试用次数!")
        Syscmd.Project.
Exit()
    End
If
End
If
n = n +
1
SaveConfigValue(
"Count",n)

 

 

请问大师们 划线这段代码起什么作用  去掉后有何不妥


--  作者:狐狸爸爸
--  发布时间:2010/6/4 14:47:00
--  

判断刚刚输入的注册码是否正确,如果不正确,且超过60的使用次数,则退出系统