设为首页
加入收藏
站内地图
旧版入口
当前位置:首页 > 站长学院 > 网络编程 > ASP.NET

C#定时器的使用

作者:Mossan 出处:cnblogs.com 时间:08-22 点击:

内容载入中...

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]);
                }
            }
        }

收藏本文:
】【打印页面】【推荐给朋友】【关闭窗口

站长学院

推荐信息