看下msdn的介绍http://msdn.microsoft.com/zh-cn/library/system.timers.timer.elapsed(v=vs.110).aspx

解决方案 »

  1.   

    报的什么错
    timer.Interval设置了吗?
    timer.Close之后,如果再Check,timer.AutoReset将报空引用
    建议在Form.Close中释放,或者在if (this.sfjz.Checked)分支里先判断timer== null就new一个if (this.sfjz.Checked)
                {
                    timer.AutoReset = true;   //设置是执行一次(false)还是一直执行(true)
                    timer.Elapsed += new ElapsedEventHandler(timerUrlText); //到达时间的时候执行事件;   
                    timer.Enabled = true;   //先给好所有参数再启动
                }
                else {
                    this.urltext.Items.Clear();
                    Console.WriteLine("on");
                    //timer.Close();  这行不要,移到Form.Close中释放
                }