Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2010
    Posts
    9

    Unanswered: Using a "keygen" to activate apps for new clients

    I would like to add a "keygen" function to my application where a "code" is generated the first time the client opens the application. I then add this code from the client to an application and create a new code, that the client has to add in order to start using the app, as it is then activated.
    Any suggestions?

  2. #2
    Join Date
    Jan 2009
    Location
    Kerala, India
    Posts
    183
    Every time you Run the following Function it will generate a two digit Random Number:

    Code:
    Public Function keygen() As Single
    Dim num1 As Single
    Dim m_min As Long, m_max As Long
    
    m_min = 10
    m_max = 99
    Randomize Timer
    num1 = Int(Rnd(Timer) * (m_max - m_min)) + m_min
    keygen = num1
    
    End Function
    If you want a four digit Random Number then change the m_min & m_max variable values to 1000 and 9999 respectively.
    www.MsAccessTips.com (Learn MS-Access Tips & Tricks)
    Learn Advanced MS-Access Programming with sample VBA Code.

    All responses are based on Access 2003/2007

  3. #3
    Join Date
    Nov 2011
    Posts
    413

    KeyGen

    Here is probably what you are after.Hope it helps.

    Regards, Burrina
    Attached Files Attached Files

  4. #4
    Join Date
    Oct 2010
    Posts
    9
    Thx Burrina for that code generator.
    How do you suggest i use it, as i need the client to phone me with with this serial code generated on his system, with this little app of yours, which is saved somewhere on the pc.. I then add the code to my app, decrypt it and give the client a new code to enter, and it is saved in a secret file which opens the application for say 12 months only.
    Please assist if you can

  5. #5
    Join Date
    Oct 2010
    Posts
    9
    thx apr pillai for your effort. i will use that as plan B maybe

  6. #6
    Join Date
    Nov 2011
    Posts
    413

    30 Days db to go with KeyGen

    Sorry, forgot the other part. DO NOT OPEN any forms other than in design mode or tables as it will set your 30 day period start date. Hold down shift key when opening. Copy all these files into your db when you are ready to distribute.Then the autoexec macro will do the rest.Design the forms,frmSwitchboard,frmSplash and frmDEMOSPLASH to your liking.The customer can try for 30 days without having to get a key from you, then simply use the KeyGen to generate one and give to Customer when payment has been made.

    Good Luck with your project.
    Attached Files Attached Files

  7. #7
    Join Date
    Jan 2009
    Location
    Kerala, India
    Posts
    183
    You may save the code in a standard module of any database, where you want the number get generated. The program can be called from anywhere to return a random 2 digit number (or 4 digit number if changes where made as I have mentioned in the above post).

    Example:
    1. From a Text Box on a Form:
    =kengen()
    The generated number will be displayed in the text box.
    2. From a MsgBox:
    MsgBox "Code : " & keygen()
    3. From a Report Control, like example one.

    Every time the function is called a new random number is generated. Since, the number range is limited to 2 digits repetition of an earlier generated number can occur. It is better to change the program to generate 4 or 5 digit.

    For 5 digit numbers set m_min=10000 and m_max = 99999.
    www.MsAccessTips.com (Learn MS-Access Tips & Tricks)
    Learn Advanced MS-Access Programming with sample VBA Code.

    All responses are based on Access 2003/2007

Posting Permissions

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