加好友 发短信
等级:版主
帖子:85326
积分:427815
威望:0
精华:5
注册:2012/10/18 22:13:00
|
Post By:2019/4/10 18:05:00 [显示全部帖子]
Dim n As Integer = Registry.GetValue("HKEY_CURRENT_USER\Software\MyAPP","Count",0) Dim Code As String =Registry.GetValue("HKEY_CURRENT_USER\Software\MyAPP","Register" & HardDiskID,"") Registry.SetValue("HKEY_CURRENT_USER\Software\MyAPP","Count", n+1) Dim Ok As Boolean If Code > "" AndAlso DecryptText(Code,"acbd","bad") = HardDiskID AndAlso Tables("注册用户信息表").Current IsNot Nothing Then '如果注册码正确 StatusBar.DefaultMessage ="POS机进销存管理系统 2.0 " & Tables("注册用户信息表").Current("公司名称") OK = True Else If n >=20 AndAlso n < 30 Then Forms("系统注册窗体").Open() Code = Registry.GetValue("HKEY_CURRENT_USER\Software\MyAPP","Register" & HardDiskID,"") If Code > "" AndAlso DecryptText(Code,"acbd","bad") = HardDiskID Then '如果注册码正确 StatusBar.DefaultMessage ="POS机进销存管理系统 2.0 " & Tables("注册用户信息表").Current("公司名称") OK = True End If ElseIf n >= 30 AndAlso Ok = False Then Dim Result As DialogResult Result = MessageBox.Show("您使用的软件已经超过使用次数,需要注册才能使用,是否注册?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If Result = DialogResult.Yes Then Forms("系统注册窗体").Open() Code = Registry.GetValue("HKEY_CURRENT_USER\Software\MyAPP","Register" & HardDiskID,"") If Code > "" AndAlso DecryptText(Code,"acbd","bad") = HardDiskID AndAlso Tables("注册用户信息表").Current IsNot Nothing Then '如果注册码正确 StatusBar.DefaultMessage ="POS机进销存管理系统 2.0 " & Tables("注册用户信息表").Current("公司名称") OK = True Else Return End If Else System.Diagnostics.Process.GetCurrentProcess().Kill End If End If StatusBar.DefaultMessage ="POS机进销存管理系统 2.0 " & " 试用版" End If
|
|