5分钟后如何使用计时器更新时间 [英] how to use timer for update time after 5 min

查看:124
本文介绍了5分钟后如何使用计时器更新时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在注册表中5分钟后使用计时器来更新时间.我的注册表文件在"SOFTWARE \\ Microsoft \\ Windows \\ CurrentVersion \\ Run"文件中.它仅在计算机启动时第一次运行.我想在5分钟后自动更新注册表中的时间.

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.

推荐答案

根据您的回复,您该做什么:

1.每5分钟更新一次注册表值.在Winform程序中,并且仅在程序运行时.

然后查看 System.Windows.Forms.Timer [ ^ ]或 System.Timers.Timer [计划按特定间隔运行的Windows服务 [ ^ ]

在命令提示符"下,键入:SCHTASKS
并按照说明进行操作.
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.


这篇关于5分钟后如何使用计时器更新时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆