以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  软件注册报错如何修改  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=123445)

--  作者:weibu
--  发布时间:2018/8/15 8:51:00
--  软件注册报错如何修改
软件注册时,注册码填写的错误位数后弹出如下框,关键时点击关闭报错框不显示注册窗口。
希望关闭报错框后弹出注册窗口如何修改代码
图片点击可在新窗口打开查看此主题相关图片如下:微信截图_20180815084900.png
图片点击可在新窗口打开查看

Dim n As Integer = GetConfigValue("Count",1)
Dim Code As String = GetConfigValue("Register" & ComputerId,"")
Dim Ok As Boolean 
If Code > "" AndAlso DecryptText(Code,"yzz","yzz") = ComputerId Then \'如果注册码正确
    OK = True
Else
    If n > 30 Then
        Forms("注册").Open()
        Code = GetConfigValue("Register" & ComputerId,"")
        If Code > "" AndAlso DecryptText(Code,"yzz","yzz") = 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)     \'用户注册试用次数限制

--  作者:有点甜
--  发布时间:2018/8/15 9:01:00
--  

重写解密函数,在全局代码加入这句代码

 

Public function DecryptText(s As String, m1 As String, m2 As String) As String
try
    Return Foxtable.DecryptText(s,m1,m2)
catch ex As Exception
    Return Nothing
End try
End Function