C#在特定时间执行函数 [英] C# Execute function at specific time

查看:18
本文介绍了C#在特定时间执行函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个小 Windows 窗体程序来自动备份我磁盘上的一些文件.现在我需要在执行之前按下一个按钮,但我想让程序运行并在凌晨 3 点运行执行备份的功能.

I made a little Windows Forms program to do some auto backup of some files on my disk. Right now I need to push a button before it is executed, but I want to make the program running and at 3am run the function that does the backup.

我进行了一些研究,发现我需要一个计时器,但我没有使用它,因此它在特定时间执行.

I've researched a bit and found out i need a timer for this, but I've failed to use it so it executes at a specific time.

希望你能帮帮我.:-)

I hope you can help me out. :-)

谢谢!

推荐答案

不是 100% 上当受骗,但您会发现 这个问题很有趣.;)

Not a 100% dupe, but you'll find this SO question interesting. ;)

包含对 quartzTimer 和其他选项的引用.

Contains references to quartzTimer and other options.

这篇关于C#在特定时间执行函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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