在global.asax 中使用.


Timer timer;

    Timer timerUrl;

    void Application_Start(object sender, EventArgs e)
    {

        TimerCallback callBack2 = new TimerCallback(Test2);
        timerUrl = new Timer(callBack2, sender, 1000, 1000);
    }

    private void Test2(Object state)
    {
        // 定时操作写到这里
       }

 

    void Application_End(object sender, EventArgs e)
    {
        timerUrl.Dispose();
    }

相关文章:

  • 2021-07-06
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-03
猜你喜欢
  • 2021-09-02
  • 2021-06-29
  • 2021-12-20
相关资源
相似解决方案