How do I set an expiration date for my Visual Basic exe

Posted on 2009-04-24
Last Modified: 2013-12-26
I have a vb5 program that I would like to expire in 30 days of usage. Your help is appreciated.
Question by:davidgm
    LVL 69

    Accepted Solution

    LVL 14

    Expert Comment

    Put this in your Form_Load event:
    Dim txt As String
    txt = GetSetting(UCase$(App.EXEName), "License", "StartDatim")
    If Len(txt$) Then
         If DateDiff("d", Cdate(txt), Now) > 30 Then
              Call DeleteSetting(UCase$(App.EXEName), "License")
              End     'you can replace this with a MsgBox and then provide limited functionality, etc.
         End If
         Call SaveSetting(UCase$(App.EXEName), "License", "StartDatim", Now)
    End If

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
    Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now