I need to set a limit on my application working...

  • Thread starter Thread starter Scott
  • Start date Start date
S

Scott

I need to set a limit on my application working... I want the application not to work as from 31/03/05 and I need to know how to code this. Surely there must be a simple code to check the date at start-up of the app??

How do I do this???



Scott
 
You can use DateTime.Now to get the current date and time on whatever computer it is running on.

I need to set a limit on my application working... I want the application not to work as from 31/03/05 and I need to know how to code this. Surely there must be a simple code to check the date at start-up of the app??

How do I do this???



Scott
 
I'm aware of that, but what code do I do to cancel the app and bring up a text saying "expired!" before the app is useful


You can use DateTime.Now to get the current date and time on whatever computer it is running on.

I need to set a limit on my application working... I want the application not to work as from 31/03/05 and I need to know how to code this. Surely there must be a simple code to check the date at start-up of the app??

How do I do this???



Scott
 
MessageBox.Show("Expired!")
Application.Exit()
I'm aware of that, but what code do I do to cancel the app and bring up a text saying "expired!" before the app is useful


You can use DateTime.Now to get the current date and time on whatever computer it is running on.

I need to set a limit on my application working... I want the application not to work as from 31/03/05 and I need to know how to code this. Surely there must be a simple code to check the date at start-up of the app??

How do I do this???



Scott
 
You could show a MessageBox and then Application.Exit

However, you sh ould be aware that this will be easily defeated by hackers...
I'm aware of that, but what code do I do to cancel the app and bring up a text saying "expired!" before the app is useful


You can use DateTime.Now to get the current date and time on whatever computer it is running on.

I need to set a limit on my application working... I want the application not to work as from 31/03/05 and I need to know how to code this. Surely there must be a simple code to check the date at start-up of the app??

How do I do this???



Scott
 
Some apps don't have a sub main. They have a form as a start up object.
 
Marina said:
Some apps don't have a sub main. They have a form as a start up object.

MSDN on 'Application.Exit':

---
*CAUTION* The 'Form.Closed' and 'Form.Closing' events are not raised when
the 'Application.Exit' method is called to exit your application. If you
have validation code in either of these events that must be executed, you
should call the 'Form.Close' method for each open form individually before
calling the 'Exit' method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top