Results 1 to 6 of 6

Thread: how to make a trial software

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2002
    Posts
    1

    Question how to make a trial software

    Hello,
    I need my app to expire after 30 days of use. How can I do this?
    If you dont have the code just tell me the process to make it a trial one then I'll research a little more.

    Thanks in advance

    adol
    adol

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    You could write the system date to a registry key when the app first runs...

    Or you could write the system date to a data file in the Windows directory (no one ever looks there)...

  3. #3
    Hyperactive Member gamezfreakuk's Avatar
    Join Date
    Mar 2002
    Location
    Nottingham, UK
    Posts
    302
    See a thing called "search" at the top, use it, many people have asked this question
    Gamezfreak
    Visual Basic 6 Enterprise Edition
    Borland C++ Builder 6 Enterprise Edition

  4. #4
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    You need to get the date when the program first runs, then store it somewhere in the registry, most likely encrypted, then when the program loads each time after that, it should check that encrypted registry key. If the current date is 30 days after the first date the program was run, then you need to disable the program. The thing is that this isn't the best way to release software. People can easily find ways to crack software with full features and 30 day trials. It is better to strip some code out of the trial version, like completely remove the option to save. Then they cannot crack the program, and you will end up making more money if people want the software.
    <removed by admin>

  5. #5
    Hyperactive Member
    Join Date
    Oct 2001
    Posts
    256
    Begs the question....

    what is the most accurate way to check if one "Date" is more than 30 days past another "Date"?

  6. #6
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    here is a sample. not a good protection, but it should give you some ideas

    VB Code:
    1. 'Author: Reginald Wheat
    2.  
    3. Option Explicit
    4.  
    5. Public Function DateGood(NumDays As Integer) As Boolean
    6.     'The purpose of this module is to allow you to place a time
    7.     'limit on the unregistered use of your shareware application.
    8.     'This module can not be defeated by rolling back the system clock.
    9.     'Simply call the DateGood function when your application is first
    10.     'loading, passing it the number of days it can be used without
    11.     'registering.
    12.     '
    13.     'Ex: If DateGood(30)=False Then
    14.     ' CrippleApplication
    15.     ' End if
    16.     'Register Parameters:
    17.     ' CRD: Current Run Date
    18.     ' LRD: Last Run Date
    19.     ' FRD: First Run Date
    20.  
    21.     Dim TmpCRD As Date
    22.     Dim TmpLRD As Date
    23.     Dim TmpFRD As Date
    24.  
    25.     TmpCRD = Format(Now, "m/d/yy")
    26.     TmpLRD = GetSetting(App.EXEName, "Param", "LRD", "1/1/2000")
    27.     TmpFRD = GetSetting(App.EXEName, "Param", "FRD", "1/1/2000")
    28.     DateGood = False
    29.  
    30.     'If this is the applications first load, write initial settings
    31.     'to the register
    32.     If TmpLRD = "1/1/2000" Then
    33.         SaveSetting App.EXEName, "Param", "LRD", TmpCRD
    34.         SaveSetting App.EXEName, "Param", "FRD", TmpCRD
    35.     End If
    36.     'Read LRD and FRD from register
    37.     TmpLRD = GetSetting(App.EXEName, "Param", "LRD", "1/1/2000")
    38.     TmpFRD = GetSetting(App.EXEName, "Param", "FRD", "1/1/2000")
    39.  
    40.     If TmpFRD > TmpCRD Then 'System clock rolled back
    41.         DateGood = False
    42.     ElseIf Now > DateAdd("d", NumDays, TmpFRD) Then 'Expiration expired
    43.         DateGood = False
    44.     ElseIf TmpCRD > TmpLRD Then 'Everything OK write New LRD date
    45.         SaveSetting App.EXEName, "Param", "LRD", TmpCRD
    46.         DateGood = True
    47.     ElseIf TmpCRD = Format(TmpLRD, "m/d/yy") Then
    48.         DateGood = True
    49.     Else
    50.         DateGood = False
    51.     End If
    52. End Function
    53.  
    54.  
    55. 'Usage
    56.  
    57.  Private Sub Form_Activate()
    58.     If Not DateGood(30) Then
    59.         MsgBox "Trial Period Expired!", vbExclamation, "Unregistered application"
    60.         Unload Me
    61.     End If
    62. End Sub
    -= a peet post =-

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width