|
-
Mar 20th, 2006, 10:03 PM
#1
Thread Starter
Hyperactive Member
Date & Time Problems
Sup Programmers,
I have been testing my program, and I realized that if any of my testers lend the program to other people, then the amount of customers would probably decrease for me.
I need to create a code that checks if lets say 1 month has passed since the program was first opened. I will create a little password window to reset the timing to 0 days so I can reuse it. The only problem I have is that what If someone starts the program and 1 week later gives it to another user, would the start date still be the same? Would this 1 month free trial thing still work?
And the main problem is that I don't know how to store dates, and work with them. So could someone please help me with this code. Remember I need to make sure that after an amount of days, including time, even if it is one minute past the 30 day period, the program either deletes itself or, loads a blank form that has a message to buy it.
Khanjan
Your help is extremely appreciated.
Hey... If you found this post helpful please rate it.

-
Mar 20th, 2006, 10:12 PM
#2
Fanatic Member
Re: Date & Time Problems
try to put your trial period date data in a textfile... after installation, i guess you can create a BAT file to create the file... then, everyday, let your app compare the system date from the date in the textfile... afterwards, you know wat to do...
WARNING: Excessive coding is dangerous to your health... if symptoms persist insult your doctor...
-
Mar 20th, 2006, 11:23 PM
#3
Thread Starter
Hyperactive Member
Re: Date & Time Problems
But how do I collect the date when the program was first opened and store it in a text file? I am totally new to dates and stuff.
I have no clue what a BAT file is.
How about this, I can just create three files.
1) Month
2) Day
3) Year
Then I can use their names to check my dates by seperating each time section and matching them. Is it possible? Sounds weird to me.
Is it also possible to make the program delete itself?
Hey... If you found this post helpful please rate it.

-
Mar 21st, 2006, 02:03 AM
#4
Frenzied Member
Re: Date & Time Problems
aside from creating a BAT file, you can also create a text file using vb to store such information.
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Mar 26th, 2006, 12:09 AM
#5
Thread Starter
Hyperactive Member
Re: Date & Time Problems
But can someone please help me generate a code for this???
Hey... If you found this post helpful please rate it.

-
Mar 26th, 2006, 02:36 AM
#6
Lively Member
Re: Date & Time Problems
I hope this will be of your use http://www.activelock.com/
-
Mar 26th, 2006, 02:52 AM
#7
Re: Date & Time Problems
You could do something like this:
VB Code:
Option Explicit
Dim RegDate As Date
Private Sub Form_Load()
'
' Read the registry to get the install date
'
RegDate = GetSetting("MyApp", "Licence", "InstallDate", 0)
If RegDate = 0 Then
'
' App hasn't been run before (on this machine)
' So write the current date & time to the registry
'
SaveSetting "MyApp", "Licence", "InstallDate", Now
Else
'
' Check whether more than 30 days has passed
'
If DateDiff("d", RegDate, Now) > 30 Then
MsgBox "This prog has expired"
End If
End If
End Sub
Note that this is very simple to bypass. You only need to either delete the registry entry or modify the date stored there for this code to be useless. It will work OK for non tech-savvy users though.
Pete
No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.
-
Mar 26th, 2006, 03:07 AM
#8
Re: Date & Time Problems
Instead of making the program expire after 1 month. Why not make it after 10 minutes/ or any other short time. That way if someone does pass it on to anyone else. It won't be much use as it will only work for 10 minutes before having to close it, and re-eopen it to reuse it.
-
Mar 26th, 2006, 03:28 AM
#9
Conquistador
Re: Date & Time Problems
Please search the forums next time! I think this question's probably been answered ~twice in the threads available on this forum's index!
If your program is useful, a simple registry date check isn't going to stop that many people. The registry would be the first place i'd check for a datestamp if I wanted to keep using a program.
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
|