本文介绍了如何在c#中使用计时器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在c#中使用定时器控件,所以建议我以哪种方式在我的程序中使用定时器。
i want to use the timer control in the c# so suggest me in which way i can use the timer in my program.
推荐答案实际上定时器用于你可以在其他工作中以特定的间隔在后端工作。它可以用来在同时处理表单时加载大量数据。 actually timer is used to do work in specific intervals in back end while you can do your other work.It can be used to load huge amount of data while working on the form simultaneously.
使用计时器 class [ ^ ]。
HI 如果您在Windows应用程序上工作.. 这段代码可行.... HI if u r working on windows application.. this code will work.... System.Timers.Timer timer = new System.Timers.Timer(1000); // 10 seconds private void Form1_Load(object sender, EventArgs e) { timer.Elapsed += timer_Elapsed; timer.Enabled = true; } void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { timer.Enabled = false; MessageBox.Show("time out"); }
更多推荐
如何在c#中使用计时器
发布评论