初学c# 定时器实在不知道为什么调刷新 items报异常 看下msdn的介绍http://msdn.microsoft.com/zh-cn/library/system.timers.timer.elapsed(v=vs.110).aspx 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 报的什么错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中释放 } 数字格式化错误 try catch的使用 求一个自动根据用户名直接做二级域名的思路 DataGridView的一个小问题帮忙解决一下 关于软件设计的一些问题 送分100 求解难题 tabcontrol控件中的tabPage顺序问题!? 谁能提供一些,C# + SQL Sever 2000的源代码啊? 一个保存路径的问题,急急!!! 动态生成类中的问题,请 xiammy(傻二哥) 继续帮忙 win7 下写权限 Visual Studio2012中编译C语言#include就报错了.
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中释放
}