-
Program Crash
How do you crash a program after 30 days and then get it to disply a message
box to the user when they try and open it to say it has now expired
-
Re: Program Crash
The first time the app is run, you would create an entry somewhere (in the
registry or some other file) that would contain the current date. Then each
time the app is started, it would compare that date to the current date
usind DateDiff and if the difference is more than 30 days, display a message
and then terminate the program. However, this is very basic and does not
prevent someone from setting the system date back to get around the issue.
Daryl
"Hughes" <chrisw@aipgroup.com> wrote in message
news:3b03e348$1@news.devx.com...
>
> How do you crash a program after 30 days and then get it to disply a
message
> box to the user when they try and open it to say it has now expired
-
Re: Program Crash
Cheers for the responce
what sort of code do i use for this as i not sure how to put it
chris
"Daryl Muellenberg" <dmuellenberg@agris.com> wrote:
>The first time the app is run, you would create an entry somewhere (in the
>registry or some other file) that would contain the current date. Then each
>time the app is started, it would compare that date to the current date
>usind DateDiff and if the difference is more than 30 days, display a message
>and then terminate the program. However, this is very basic and does not
>prevent someone from setting the system date back to get around the issue.
>
>Daryl
>
>"Hughes" <chrisw@aipgroup.com> wrote in message
>news:3b03e348$1@news.devx.com...
>>
>> How do you crash a program after 30 days and then get it to disply a
>message
>> box to the user when they try and open it to say it has now expired
>
>
-
Re: Program Crash
Here is some basic code that uses an ini file to store the date:
Dim iFile as Integer, sDate as String
If Dir$(MyApp.ini) = "" Then
'MyApp.ini is not present, so it is first time app is run.
iFile = FreeFile
Open "MyApp.ini" For OutPut as #iFile
Print #iFile, Date
Close #iFile
Else
'MyApp.ini is present, check for days since first install.
Open "MyApp.ini" For Input As #iFile
Input #iFile, sDate
Close #iFile
If DateDiff("d", Date, CDate(sDate)) > 30 Then
MsgBox "30 days are up!"
Unload Me
End If
End If
"chris" <chris@aipgroup.com> wrote in message
news:3b040b52$1@news.devx.com...
>
> Cheers for the responce
> what sort of code do i use for this as i not sure how to put it
> chris
>
> "Daryl Muellenberg" <dmuellenberg@agris.com> wrote:
> >The first time the app is run, you would create an entry somewhere (in
the
> >registry or some other file) that would contain the current date. Then
each
> >time the app is started, it would compare that date to the current date
> >usind DateDiff and if the difference is more than 30 days, display a
message
> >and then terminate the program. However, this is very basic and does not
> >prevent someone from setting the system date back to get around the
issue.
> >
> >Daryl
> >
> >"Hughes" <chrisw@aipgroup.com> wrote in message
> >news:3b03e348$1@news.devx.com...
> >>
> >> How do you crash a program after 30 days and then get it to disply a
> >message
> >> box to the user when they try and open it to say it has now expired
> >
> >
>
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks