实例化timer控件,然后给个委托过去就成了
代码如下:
System.Timers.Timer crazycoderTimer= new System.Timers.Timer(30 * 60 * 1000);//定义为30分钟执行一次
crazycoderTimer.Elapsed += new System.Timers.ElapsedEventHandler(crazycoderTimer_Tick);
private void crazycoderTimer_Tick(object sender, System.Timers.ElapsedEventArgs e)
{
//定时执行代码 比如定时访问http://www.crazycoder.cn/
}
线程 Timer类和Timer类(不同命名空间,总共有三个Timer)
用线程。。。。
网上有教程,其实很简单。。。。
可以用线程实现