VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Giving days limit to your Shareware Program (30 days only).

by Charlie M. Valizado (4 Submissions)
Category: Registry
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sat 6th January 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Giving days limit to your Shareware Program (30 days only).

Rate Giving days limit to your Shareware Program (30 days only).



'COPY THESE CODES TO YOUR SPLASHSCREEN 
'COPY THESE CODES TO YOUR SPLASHSCREEN 
'COPY THESE CODES TO YOUR SPLASHSCREEN 
'COPY THESE CODES TO YOUR SPLASHSCREEN 
'APPLICABLE IN activate or load event
'APPLICABLE IN activate or load event

Dim startdate As String
Dim differenceofdate
Dim TRACEDATE As String
Dim newdate
Dim chk

    If GetSetting(App.Title, "Startup", "counter", "") = "" Then
       SaveSetting App.Title, "Startup", "counter", 1
       SaveSetting App.Title, "Startup", "Started", Format(Date, "mm dd yyyy")
       SaveSetting App.Title, "Startup", "Last Used", Format(Date, "mm dd yyyy")
       lblcnt.Caption = "1"
       
    ElseIf GetSetting(App.Title, "Startup", "counter", "") = "31" Then
       MsgBox "Thank you for using this trial SOFTWARE!!" & Chr(10) + Chr(13) & "Please STOP running this system or else all data had been entered will lost.", vbCritical, "Thank you"
       End
       
 Else
       TRACEDATE = GetSetting(App.Title, "Startup", "Last Used", "")
chk = DateDiff("d", CDate(TRACEDATE), Now)
       If chk < 0 Then 'CHECK IF THE DATE WAS CHANGE which is lesser than the PREVIOUS DATE WHERE THE SYSTEM USED.
          MsgBox "Your system date is invalid." & Chr(10) + Chr(13) & "Please change it right now or else you will nolonger use this software anymore!!", vbCritical, "Invalid date"
                End
       Else
      startdate = GetSetting(App.Title, "Startup", "Started", "")
       differenceofdate = DateDiff("d", startdate, Now)  
         If differenceofdate <> 0 Then
                    lblcnt.Caption = differenceofdate + 1
        SaveSetting App.Title, "Startup", "Last Used", Format(Now, "MM DD YYYY")
               SaveSetting App.Title, "Startup", "counter", differenceofdate + 1
                End If
                If differenceofdate = 0 Then
                lblcnt.Caption = GetSetting(App.Title, "Startup", "Counter", "")
                End If
       End If
  End If
End Sub

Download this snippet    Add to My Saved Code

Giving days limit to your Shareware Program (30 days only). Comments

No comments have been posted about Giving days limit to your Shareware Program (30 days only).. Why not be the first to post a comment about Giving days limit to your Shareware Program (30 days only)..

Post your comment

Subject:
Message:
0/1000 characters