1,105,352 Community Members

Set timer

Member Avatar
achinthaadd
Newbie Poster
20 posts since Aug 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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,

Member Avatar
Luc001
Posting Pro in Training
455 posts since Mar 2010
Reputation Points: 77 [?]
Q&As Helped to Solve: 117 [?]
Skill Endorsements: 3 [?]
 
0
 

Hi,

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

Member Avatar
achinthaadd
Newbie Poster
20 posts since Aug 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
Begginnerdev
Veteran Poster
1,142 posts since Apr 2010
Reputation Points: 251 [?]
Q&As Helped to Solve: 191 [?]
Skill Endorsements: 15 [?]
 
0
 

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

Member Avatar
achinthaadd
Newbie Poster
20 posts since Aug 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
Reverend Jim
Noli mentula
5,445 posts since Aug 2010
Reputation Points: 746 [?]
Q&As Helped to Solve: 653 [?]
Skill Endorsements: 51 [?]
Moderator
Featured
 
0
 

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.

Member Avatar
TnTinMN
Practically a Master Poster
640 posts since Jun 2012
Reputation Points: 418 [?]
Q&As Helped to Solve: 152 [?]
Skill Endorsements: 16 [?]
 
0
 

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.

Member Avatar
achinthaadd
Newbie Poster
20 posts since Aug 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
achinthaadd
Newbie Poster
20 posts since Aug 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Question Answered as of 1 Year Ago by TnTinMN, Luc001, Begginnerdev and 1 other
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article