|
抄来的试用版限制时间与日期的方法, 看看对朋友们有没有帮助的.
可用注册表简单地保存已用的天数或次数 '
次数限制(如30次):
Private Sub Form_Load()
Dim a As Long
Dim b As Long
b = GetSetting("MyApp", "set", "times", 51345)
a = b Xor 51345
If a < 30 Then
MsgBox "现在剩下:" & 30 - a & "试用次数,好好珍惜!"
a = a + 1
b = b Xor 51345
SaveSetting "MyApp", "set", "times", b
Else
MsgBox "试用次数已满,请联系gfuuyygy!"
End If
End Sub
'时间限制的(如10天)
Private Sub Form_Load()
Dim a As Long
a = GetSetting("MyApp", "set", "day", 0)
If a = 10 Then
MsgBox "试用期已过,请联系gfuuyygy!"
Else
MsgBox "现在剩下:" & 10 - a & "试用天数,好好珍惜!"
if day(now)-a>0 then
a = RemainDay + 1
SaveSetting "MyApp", "set", "times", a
End if
End if
End Sub |
|