Program Crash


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Program Crash

  1. #1
    Hughes Guest

    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

  2. #2
    Daryl Muellenberg Guest

    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




  3. #3
    chris Guest

    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

    >
    >



  4. #4
    Daryl Muellenberg Guest

    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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center