protected void application_start(object sender, eventargs e)
{
init();
system.timers.timer mytimer=new system.timers.timer(3000);
//关联事件
mytimer.elapsed += new system.timers.elapsedeventhandler(mytimer_elapsed);
mytimer.autoreset = true ;
mytimer.enabled = true ;
}
private void mytimer_elapsed(object sender, system.timers.elapsedeventargs e)
{
//获取当前时间
init();
}
private void init()
{
application.lock();
application[“timedemo”]= datetime.now.tostring();
application.unlock();
}