以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  寻求注册表加密的例子  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=52363)

--  作者:jygyyl
--  发布时间:2014/6/14 9:54:00
--  寻求注册表加密的例子
各位老师,有无注册表加密的例子,共享一下呗!
--  作者:Bin
--  发布时间:2014/6/14 10:00:00
--  
http://www.foxtable.com/help/topics/1545.htm


--  作者:jygyyl
--  发布时间:2014/6/14 11:25:00
--  回复:(Bin)http://www.foxtable.com/help/topics/1...

是这样吗?


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("HKEY_CURRENT_USER\\Software\\MyApp",
"Count",n)

[此贴子已经被作者于2014-6-14 11:25:54编辑过]

--  作者:Bin
--  发布时间:2014/6/14 11:28:00
--  
不是用SaveConfigValue 请看帮助连接.