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,"")
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
Registry.SetValue("HKEY_CURRENT_USER\Software\MyAPP","Count",)
麻烦看看拿错了n 值到21就不加了