We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,886 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Set timer

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,

6
Contributors
8
Replies
1 Week
Discussion Span
3 Months Ago
Last Updated
18
Views
Question
Answered
achinthaadd
Newbie Poster
20 posts since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Hi,

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

Luc001
Posting Pro in Training
413 posts since Mar 2010
Reputation Points: 93
Solved Threads: 107
Skill Endorsements: 1

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

achinthaadd
Newbie Poster
20 posts since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 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...

Begginnerdev
Practically a Posting Shark
861 posts since Apr 2010
Reputation Points: 184
Solved Threads: 142
Skill Endorsements: 8

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

achinthaadd
Newbie Poster
20 posts since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 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.

Reverend Jim
Carpe per diem
Moderator
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

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

achinthaadd
Newbie Poster
20 posts since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

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

achinthaadd
Newbie Poster
20 posts since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 3 Months Ago by Luc001, Begginnerdev, Reverend Jim and 1 other

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0861 seconds using 2.73MB