c# 定时器

        private static System.Windows.Threading.DispatcherTimer readDataTimer = null; //用于触发定时器

 

                //倒计时
                readDataTimer = new System.Windows.Threading.DispatcherTimer();
                readDataTimer.Tick += new EventHandler(ShowLayer);
                readDataTimer.Interval = new TimeSpan(0, 0, 0, 2);
                readDataTimer.Start();

 

       private void CountDown(object sender, EventArgs e)
          {

      //写你需要执行的代码

      }

 

posted @ 2016-12-15 17:31  杰520  阅读(214)  评论(0编辑  收藏  举报