hi, i want a get msgbox(" Time Out") , when click some button then after 10 days ago, it may be close my application and it can not affect to time ( 10 days), i dont know how it code, please help me. tks,

4 Years
Discussion Span
Last Post by achinthaadd


I don't understand your question.
Do you want some code that after 10 days your application will expire?


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...


Keep the date/time stored that the application launched the First launch and check to see if the current date is 10 days...

Edited by Begginnerdev


i'm new to vb , can u give code for me, and i don't know how to code for registry, please help me..


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


You can keep track of elapsed time by using a TimeSpan or unsigned int.


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.


data base is ms access data base, and usualy application has some button ( 10 days) when it click data base will delete after 10 days, i want to do that, how to store some infor in data base ( like what). can u give example code for me....

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.