You will have to keep track of total time elapsed that the application has ran.
You can't assume the app will stay loaded into memory for 10 days - therefore you will have to look into storing the total time it has spent running.
You can use Registry Keys, Serialized files, text files (Easy to "hack") to store the time.
You pull the time into the application on load and start the timer, save the total + instance time on exit.
You check the time on load to see if time = 10days and if so delete the file...
OR
Keep the date/time stored that the application launched the First launch and check to see if the current date is 10 days...
Begginnerdev
Practically a Posting Shark
861 posts since Apr 2010
Reputation Points: 184
Solved Threads: 142
Skill Endorsements: 8
It's probably easier to use an application setting instead of the registry. If you are using VB 2010, go to Project -> Properties, then go to the Settings page. You'll have to pick an appropriate variable type. You can access it by
My.Settings.varname
You can keep track of elapsed time by using a TimeSpan or unsigned int.
Reverend Jim
Carpe per diem
3,596 posts since Aug 2010
Reputation Points: 561
Solved Threads: 446
Skill Endorsements: 32
You have indicated that you have a database. Why not store the info there?
What type of database is it?
Registry based systems are easy to crack. Usually, all it takes is for the user to identify which key your program has added and delete it to reset the counter.
TnTinMN
Practically a Master Poster
640 posts since Jun 2012
Reputation Points: 418
Solved Threads: 148
Skill Endorsements: 13
Question Answered as of 3 Months Ago by
Luc001,
Begginnerdev,
Reverend Jim
and 1 other