C#定时器的使用
点击次数:43 次 发布日期:2008-11-21 22:24:33 作者:源代码网
|
源代码网推荐源代码网整理以下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]); } } }
|
源代码网供稿. |