Foxtable(狐表)用户栏目专家坐堂 → 如何实现注册表注册验证机制呢?


  共有2139人关注过本帖树形打印复制链接

主题:如何实现注册表注册验证机制呢?

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


加好友 发短信
等级:九尾狐 帖子:2472 积分:17346 威望:0 精华:0 注册:2013/1/31 0:03:00
如何实现注册表注册验证机制呢?  发帖心情 Post By:2019/4/10 17:17:00 [显示全部帖子]

代码如下:怎么融合在一起 让信息写入注册表  根据注册表中的数据来进行软件注册与否的提示呢?

设置信息到注册表代码如下:

Dim Count As Integer
Count = Registry.GetValue("HKEY_CURRENT_USER\Software\MyApp","Count",0)
Registry.SetValue("HKEY_CURRENT_USER\Software\MyApp","Count",Count + 1)


项目的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)


 回到顶部