Windows服务时间控件怎么调试

 

  写了timer,调试的话在构造函数里面把Elapsed方法写成null,null就可以调试了

 

     public PSJCService()
        {
            InitializeComponent();
            GetuserInfo();
            timer2 = new System.Timers.Timer();
            timer2.Interval = 60000;
            timer2.Elapsed += new System.Timers.ElapsedEventHandler(timer2_Elapsed);
            timer2_Elapsed(null,null);
            timer = new System.Timers.Timer();
            timer.Interval = 1000 * int.Parse(ConfigurationManager.AppSettings["RealTimeInterval"].ToString());
            timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
            timer_Elapsed(null, null);

        }

 

posted @ 2017-08-16 11:47  蜀云泉  阅读(273)  评论(0编辑  收藏  举报