(1)首先声明Timer变量:
//一定要声明成局部变量以保持对Timer的引用,否则会被垃圾收集器回收!
private System.Threading.Timer timerClose;
// Create a timer thread and start it
timerClose = new System.Threading.Timer(new TimerCallback(timerCall), this, 5000, 0);
反正都这么用就可以了,定义和实例分开。
http://blog.youkuaiyun.com/suncherrydream/article/details/8645642