Click here to Skip to main content
15,902,445 members
Please Sign up or sign in to vote.
3.33/5 (3 votes)
See more:
How to use timer for update time after 5 min in registry. My registry file in "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run" file. Its run only first time when computer start.I want to update time in registry after 5 min automatically.
Posted
Comments
Olivier Levrey 4-May-11 7:28am    
It is not very clear. Could you rephrase your question please?

1 solution

Based on your comment in reply, you what to:

1. Update a registry value every 5 min. in your Winform program and ONLY when your program is running.

Then look at System.Windows.Forms.Timer[^] or System.Timers.Timer[^]

Use System.Timers.Timer if do not want to block UI interface.
See the example under these two links.



-----------
Use Windows Task Scheduler.

Schedule your program to run every 5. min.

Windows service scheduled to run at specific interval[^]

Under "Command Prompt" type: SCHTASKS
And follow instructions.
 
Share this answer
 
v4
Comments
Member 7891405 4-May-11 7:46am    
how to use Windows Task Scheduler in C#.
Kim Togo 4-May-11 7:53am    
See updated answer.
Member 7891405 4-May-11 8:17am    
My application is use to generate License. I want to update time in registry for check the user is change the date or time. I store the date & time in registry when pc starts.& after that the application is close. The Task Scheduler helpful to check the customer change the date & time or not & its helps to update timing in registry. How its work?
Kim Togo 4-May-11 8:30am    
I do not follow. My the user not change the current system time ?
Member 7891405 5-May-11 4:08am    
Thanks Kim.
I Add the trigger in my application.But i want to update trigger after 5 minutes interval & this updated time store in my registry automatically because my application is run once when my Computer starts.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900