'次數限制(如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.kjueaiud.com/