Foxtable(狐表)用户栏目专家坐堂 → 代码测试


  共有1834人关注过本帖平板打印复制链接

主题:代码测试

帅哥哟,离线,有人找我吗?
爱相随
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:929 积分:6500 威望:0 精华:0 注册:2014/6/25 10:48:00
代码测试  发帖心情 Post By:2016/4/14 16:53:00 [只看该作者]

老师,下面代码是注册表的代码,经测试,有一次出现过注册窗口,以后就不再出现了,通过测试,提示第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)


 回到顶部