做一个时间限制的测试版

发表于:2007-07-14来源:作者:点击数: 标签:
可用注册表简单地保存已用的天数或次数 '次数限制(如30次)如下: Private Sub Form_Load() Dim RemainDay As Long RemainDay = GetSetting(MyApp, set, times, 0) If RemainDay = 30 Then MsgBox 试用次数已满,请…… Unload Me End If MsgBox 现在剩下
可用注册表简单地保存已用的天数或次数

'次数限制(如30次)如下:
Private Sub Form_Load()
Dim RemainDay As Long
RemainDay = GetSetting("MyApp", "set", "times", 0)
If RemainDay = 30 Then
MsgBox "试用次数已满,请……"
Unload Me
End If
MsgBox "现在剩下:" & 30 - RemainDay & "试用次数,好好珍惜!"
RemainDay = RemainDay + 1
SaveSetting "MyApp", "set", "times", RemainDay
End Sub

'时间限制的(如30天)
Private Sub Form_Load()
Dim RemainDay As Long
RemainDay = GetSetting("MyApp", "set", "day", 0)
If RemainDay = 30 Then
MsgBox "试用期已过,请……"
Unload Me
End If
MsgBox "现在剩下:" & 30 - RemainDay & "试用天数,好好珍惜!"
if day(now)-remainday>0 then RemainDay = RemainDay + 1
SaveSetting "MyApp", "set", "times", RemainDay
End Sub

原文转自:http://www.ltesting.net