|
-
Aug 21st, 2007, 02:43 PM
#1
Thread Starter
Lively Member
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.
-
Aug 21st, 2007, 03:08 PM
#2
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).
-
Aug 21st, 2007, 03:59 PM
#3
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.
-
Aug 22nd, 2007, 06:35 AM
#4
Thread Starter
Lively Member
Re: VB6 application limited runing time???
 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
-
Aug 22nd, 2007, 08:00 AM
#5
Re: VB6 application limited runing time???
I don't suppose you don't know how to write to a file?
-
Aug 22nd, 2007, 08:09 AM
#6
Thread Starter
Lively Member
Re: VB6 application limited runing time???
 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
-
Aug 22nd, 2007, 08:22 AM
#7
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
-
Aug 22nd, 2007, 08:29 AM
#8
Thread Starter
Lively Member
Re: VB6 application limited runing time???
 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
-
Aug 22nd, 2007, 08:37 AM
#9
Thread Starter
Lively Member
Re: VB6 application limited runing time???
Yes! your code worked OK and thank you very much for your help.
-
Aug 22nd, 2007, 08:41 AM
#10
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.
-
Aug 22nd, 2007, 09:46 AM
#11
Hyperactive Member
Re: [RESOLVED]VB6 application limited runing time???
 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.
-
Aug 22nd, 2007, 10:10 AM
#12
Thread Starter
Lively Member
Re: [RESOLVED]VB6 application limited runing time???
 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?
-
Aug 22nd, 2007, 10:11 AM
#13
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
-
Aug 22nd, 2007, 11:26 AM
#14
Re: VB6 application limited runing time???
 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 ...
-
Aug 22nd, 2007, 12:25 PM
#15
Re: VB6 application limited runing time???
And/or encrypt the 0 to 15 value and code the program in such a way that if there's no registry entry it won't run.
-
Aug 22nd, 2007, 02:21 PM
#16
Thread Starter
Lively Member
Re: VB6 application limited runing time???
 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?
-
Aug 22nd, 2007, 02:25 PM
#17
Thread Starter
Lively Member
Re: VB6 application limited runing time???
 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?
-
Aug 22nd, 2007, 03:03 PM
#18
Re: VB6 application limited runing time???
 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.
-
Aug 22nd, 2007, 05:05 PM
#19
Thread Starter
Lively Member
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
-
Aug 22nd, 2007, 05:42 PM
#20
Re: VB6 application limited runing time???
 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.
-
Aug 22nd, 2007, 05:52 PM
#21
Addicted Member
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.
-
Aug 23rd, 2007, 05:16 AM
#22
Thread Starter
Lively Member
Re: VB6 application limited runing time???
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|