Results 1 to 22 of 22

Thread: VB6 application limited runing time???

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    82

    Resolved VB6 application limited runing time???

    Hi VB Experts again;

    How can I set my VB6 application accessable to run just for one week as prototype application, after that it will prompt the user to ask for a password sort of....?

    Thank you

    M C Benzerari
    Last edited by M C Benzerari; Aug 22nd, 2007 at 08:43 AM.

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: VB6 application limited runing time???

    There are many different ways including some "hidden" file, registry but general idea is that you need to write start date (it could also be encrypted) and check difference in days on every launch.
    I've seen commercial apps allowing 15 launches (not even days).

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: VB6 application limited runing time???

    You can also take the approach of distributing an app that only allows for limited functionality until the user registers. If you're interested in that approach then see the A program registration scheme link in my signature.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    82

    Re: VB6 application limited runing time???

    Quote Originally Posted by RhinoBull
    There are many different ways including some "hidden" file, registry but general idea is that you need to write start date (it could also be encrypted) and check difference in days on every launch.
    I've seen commercial apps allowing 15 launches (not even days).

    That ia a good idea, what is the VB6 code of that?

    Thank you

  5. #5

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    82

    Re: VB6 application limited runing time???

    Quote Originally Posted by RhinoBull
    I don't suppose you don't know how to write to a file?
    You still did not show me What is the VB code of that 10 or 15 lunches, you do not need to suppose

  7. #7
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: VB6 application limited runing time???

    Wow... I wasn't planning doing that though - that is a very basic stuff.

    Anyway, you can have something a s simple as these few lines:
    Code:
    'NOTE: place this code to your startup form or Sub Main instead if you use that
    
    Private Sub Form_Load()
    Dim iCounter As Integer
    
        iCounter = CInt(GetSetting(App.EXEName, "trial", "count", 0))
        iCounter = iCounter + 1
        
        If iCounter < 16 Then
            SaveSetting App.EXEName, "trial", "count", iCounter
        Else
            MsgBox "The trial period is expired." & _
                   vbNewLine & _
                   "If you wish to continue to use this software you must purchase it."
            End
        End If
    
    End Sub

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    82

    Re: VB6 application limited runing time???

    Quote Originally Posted by RhinoBull
    Wow... I wasn't planning doing that though - that is a very basic stuff.

    Anyway, you can have something a s simple as these few lines:
    Code:
    'NOTE: place this code to your startup form or Sub Main instead if you use that
    
    Private Sub Form_Load()
    Dim iCounter As Integer
    
        iCounter = CInt(GetSetting(App.EXEName, "trial", "count", 0))
        iCounter = iCounter + 1
        
        If iCounter < 16 Then
            SaveSetting App.EXEName, "trial", "count", iCounter
        Else
            MsgBox "The trial period is expired." & _
                   vbNewLine & _
                   "If you wish to continue to use this software you must purchase it."
            End
        End If
    
    End Sub
    Thank you for your reply, I will try your code and let you know.

    Wow

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    82

    Resolved Re: VB6 application limited runing time???

    Yes! your code worked OK and thank you very much for your help.

  10. #10
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: [RESOLVED]VB6 application limited runing time???

    No problem. Just keep in mnd that that is a very basic and weak approach - anyone who's more or less computer literal can break that quite easy.
    So, you may try to change those hardcoded values (App.EXEName, "trial", "count") to something less obvious at least.

  11. #11
    Hyperactive Member
    Join Date
    Jul 2007
    Location
    &nbsp;
    Posts
    453

    Re: [RESOLVED]VB6 application limited runing time???

    Quote Originally Posted by RhinoBull
    No problem. Just keep in mind that that is a very basic and weak approach - anyone who's more or less computer literal can break that quite easy.
    So, you may try to change those hardcoded values (App.EXEName, "trial", "count") to something less obvious at least.
    I used that code also, and it worked fine, but it also displayed runtime error 91 for some reason...
    Haikus are easy.
    But sometimes they don't make sense.
    Refrigerator.

  12. #12

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    82

    Re: [RESOLVED]VB6 application limited runing time???

    Quote Originally Posted by RhinoBull

    No problem. Just keep in mnd that that is a very basic and weak approach - anyone who's more or less computer literal can break that quite easy.
    So, you may try to change those hardcoded values (App.EXEName, "trial", "count") to something less obvious at least.
    What you mean by that?

  13. #13
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: VB6 application limited runing time???

    What he means is that someone could open the registry go to the node and change the value from 15 back to 1 and gets to use the app again.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  14. #14
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: VB6 application limited runing time???

    Quote Originally Posted by GaryMazzone
    What he means is that someone could open the registry go to the node and change the value from 15 back to 1 and gets to use the app again.
    Exactly! So as I said you can at least change the obvious text to something that makes sense only to you - perhaps like this:
    Code:
    iCounter = CInt(GetSetting("a897", "jem099", "gtzxl", 0))
    
    '...
    
    SaveSetting "a897", "jem099", "gtzxl", iCounter
    ... or something of that nature ...

  15. #15

  16. #16

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    82

    Cool Re: VB6 application limited runing time???

    Quote Originally Posted by GaryMazzone
    What he means is that someone could open the registry go to the node and change the value from 15 back to 1 and gets to use the app again.
    the application is just a *.Exe sort of I am not going to give my source code, so how can some else access my source code, make a change on it then make .exe copy?

  17. #17

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    82

    Re: VB6 application limited runing time???

    Quote Originally Posted by GaryMazzone
    What he means is that someone could open the registry go to the node and change the value from 15 back to 1 and gets to use the app again.
    that is really strange isn't it?

  18. #18
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: VB6 application limited runing time???

    Quote Originally Posted by M C Benzerari
    that is really strange isn't it?
    What so strange about someone's changing registry values (if they know how to do that of course)? No one is going to reverse engineer your program.
    You cannot stop hacker - all you can do is make it harder for someone and following steps we recommended (including encryptions) is what you should really be doing.

    Good luck.

  19. #19

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    82

    Re: VB6 application limited runing time???

    Any way the code for the number of launches worked ok. What about if I want the application to be accessable for one month starting either from the first day it has been launched or for more specific number of days say from '1 of sep 2007 till '1 oct 2007' I would like to see the VB code in both cases please.

    Thank you

    M C Benzerari

  20. #20
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: VB6 application limited runing time???

    Quote Originally Posted by M C Benzerari
    Any way the code for the number of launches worked ok. What about if I want the application to be accessable for one month starting either from the first day it has been launched or for more specific number of days say from '1 of sep 2007 till '1 oct 2007' I would like to see the VB code in both cases please.

    Thank you

    M C Benzerari
    Why don't you try to do it yourself and then if you have problems show us your code.

  21. #21
    Addicted Member
    Join Date
    Aug 2007
    Location
    Miami, FL USA
    Posts
    171

    Re: VB6 application limited runing time???

    I would have gone the route of creating an encrypted .dat file and inserted an identifier and a checksum. This way you can edit the values on each run and/or control the termination date.

  22. #22

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    82

    Re: VB6 application limited runing time???

    Quote Originally Posted by MartinLiss
    Why don't you try to do it yourself and then if you have problems show us your code.
    That is what this forum is for thought! get what others have and compare it to what I have, and like that I can discover what is going wrong in my analogy...!

    Every day is school day isn't?

    Fortunately, above any expertise there is an expert to refer to...

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