加入收藏 | 设为首页 | 会员中心 | 我要投稿 聊城站长网 (https://www.0635zz.com/)- 智能语音交互、行业智能、AI应用、云计算、5G!
当前位置: 首页 > 综合聚焦 > 编程要点 > 语言 > 正文

C#定时器的使用代码

发布时间:2023-04-06 11:13:11 所属栏目:语言 来源:
导读:C#定时器的使用

以下为引用的内容:

Timer timer1;

this.timer1.Interval = 1000;

this.timer1.Tick = new System.EventHandler(this.timer1_Tick);

private void timer1_Tick(object sender, Ev
C#定时器的使用

以下为引用的内容:
 
Timer timer1;
 
this.timer1.Interval = 1000;
 
this.timer1.Tick = new System.EventHandler(this.timer1_Tick);
 
private void timer1_Tick(object sender, EventArgs e)
 
{
 
ArrayList AutoTask = new ArrayList();
 
AutoTask.Add("8:30:00");
 
AutoTask.Add("9:30:00");
 
AutoTask.Add("10:30:00");
 
AutoTask.Add("11:30:00");
 
for (int n = 0; n < 4; n )
 
{
 
if (dtAuto.ToLongTimeString().Equals(AutoTask[n]))
 
{
 
MessageBox.Show("现在时间是" AutoTask[n]);
 
}
 
}
 
}
 
 

(编辑:聊城站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!