Results 1 to 13 of 13

Thread: How to Make Trial Period

  1. #1

    Thread Starter
    Addicted Member BarankinBeAMan's Avatar
    Join Date
    Aug 2002
    Location
    Reston,Va
    Posts
    164

    Talking How to Make Trial Period

    What is the best way to make my application expired at certain date ?
    Registry change ?
    Thank you all !

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    London UK
    Posts
    255

    Talking

    Well, you could use the registry, BUT you couldn't do it using a key called "ExpiresOn" and filling it with "Wednesday" or something like that. To stop people from changing the key, you have to encrypt it. This can be done easily!

    OK, say you want it to expire in 30 days, and the install program makes the registry key that your program checks with, when it gets installed. Make a name for the key (let's call it "ExpiresOn", and let it contain a date which your program sets when it first starts). Instead of saving "Monday, July 4th" you use the attached MD5String() function to hash it, then save it. Now, to the pesky user, it looks like "ExpiresOn" - "a8dd73jn9f399f3jvb", and trust me the chances that they can decode that to the correct time and change it are so small that you could promise to kill yourself if they did. So now the date's in the registry and you wanna check up on it. Since there is no UnMD5String() function, you just need to use something like this:

    VB Code:
    1. On Error GoTo Error
    2. Dim i As 'Whatever format the date was in
    3. For i = Today To 30-Days-Time
    4.        If Module1.MD5String(i) <> 'the registry key entry EXACTLY Then
    5. Error:  
    6.               'sod off!
    7.               Exit Sub
    8.        Else
    9.               'come on in!
    10.        End If
    11. Next i
    The On Error statement ensures that if the user thought she'd be clever and remove the key entirely, it still doesn't let them in!

    Does this help? If you want, I can knock you up a module which can do ALL of this for you, but you'd have to wait a few days!!!
    Not at all related to sheep...

  3. #3

    Thread Starter
    Addicted Member BarankinBeAMan's Avatar
    Join Date
    Aug 2002
    Location
    Reston,Va
    Posts
    164

    Angry knock me up a module !

    That sounds interesting,
    I could wait till you are back from the islands.

    Thank you.

  4. #4
    Addicted Member
    Join Date
    Aug 2002
    Location
    London UK
    Posts
    255
    OK Sure, just give me the name/path of the reg key you want to put the expiry time in. You need to get your app to create it though!

    I should have this finished by Saturday (I'm busy tomorrow).
    Not at all related to sheep...

  5. #5
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Create a text file in obscure place on the system. Place the date, encrypted within the textfile. Wala, done....
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  6. #6
    Addicted Member
    Join Date
    Aug 2002
    Location
    London UK
    Posts
    255
    It's better to store the information in the registry, for the same reason that applications stopped using .ini files a few years ago and migrated to using the registry. And don't ask me for the reason because I don't know, I'm just sure that since applications now use the registry, there must be something better about it.
    Not at all related to sheep...

  7. #7
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Originally posted by A$$Bandit
    It's better to store the information in the registry, for the same reason that applications stopped using .ini files a few years ago and migrated to using the registry. And don't ask me for the reason because I don't know, I'm just sure that since applications now use the registry, there must be something better about it.
    Each user can have their customized configuration. All you have to do is to save their configuration in the HKCU. In the INI case, you would need to create an INI for each user, or different keys for each user in the same INI file.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  8. #8
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    But all he wants to do is terminate use of his app at a set interval...

    If you must use registry, I still suggest using a text file as extra security...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  9. #9
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You can use this activeX control: http://www.activelock.com/faq.html

    It has source code too if you want to modify it to your liking or just get ideas to make your own.

  10. #10
    Addicted Member
    Join Date
    Apr 2002
    Location
    Hyderabad,India
    Posts
    131
    Hi A$$Bandit,

    What if the user changes the date? I mean if the user installed on 1st Sept., registry entry will contain 30th Sept in encrypted format.
    But if the user manages that the date in his system never reaches 30th Sept then?

    Can you elaborate a little bit on this?

    Thanks in advance,
    Satya

  11. #11
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Originally posted by SatyaPhaniKumar
    Hi A$$Bandit,

    What if the user changes the date? I mean if the user installed on 1st Sept., registry entry will contain 30th Sept in encrypted format.
    But if the user manages that the date in his system never reaches 30th Sept then?

    Can you elaborate a little bit on this?

    Thanks in advance,
    Satya
    http://www.vbforums.com/showthread.p...ght=clock+back Check peet's code.

    If only people searched...
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  12. #12
    Addicted Member ßädbö¥'s Avatar
    Join Date
    Jul 2003
    Location
    I Lost somewhere !!
    Posts
    198

    Wink Here is ur solution .....

    It's true.... If user can change system date then he can use the software after the expiry date. here is 1 solution add encrypted string in registry and check that string everytime in ur programme and if the user use ur software **** times then change that value to some special string and if u found that string in registry then show message and end ur programme.
    I'm sure if u used this technique no 1 can hack ur software......

    ßädbö¥ Rü£z

    ICQ # : 204178672
    AOL SN : Badboy9jan
    badboy9jan<img src="images/smilies/s...g" />gmail.com

  13. #13
    Frenzied Member <ABX's Avatar
    Join Date
    Jul 2002
    Location
    Canada eh...
    Posts
    1,622
    Nothing is safe, they can disassemble your app and make it not check. Basicly if they want to use ur app and they got enough know-how they will. All you can do is make it harder but checking it in lots of locations and making the check part of core functions that need to be called.
    Tips:
    • Google is your friend! Search before posting!
    • Name your thread appropriately... "I Need Help" doesn't cut it!
    • Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
    • Allways Include the Name and Line of the Exception (if one is occuring!)
    • If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)


    If you think I was helpful, rate my post
    IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous

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