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,

Hi,

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

yes, it meaning my application's database(ms access) will delete.

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

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

My.Settings.varname

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

i solove it my way, and thanks to give some idea.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.