//timerEmail.cs
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Threading;/// <summary>
/// TimerEmail 的摘要说明
/// </summary>
public sealed class TimerEmail
{
    public TimerEmail()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
    private System.Threading.Timer _timer;
    private int _interval;
    public int Interval {
        get { return _interval; }
        set { _interval = value; }
    }
    
    public void Initialize()
    {
        Interval = 120;
        _timer = new System.Threading.Timer(TimerCallback, null, System.Threading.Timeout.Infinite, Interval * 1000);
        
    }
    private void StartAgent()
    {
        _timer.Change(0, Interval * 1000);
    }
    private void StopAgent()
    {
        _timer.Change(System.Threading.Timeout.Infinite, Interval * 1000);
    }
    private static void TimerCallback(object state)
    {
        DataTable table = new MemberDB().GetNoLoginMembers().Tables[0];
       // DataTable table1 = new OrderDB().GetNoBackScoreOrders();
        try
        {
            EmailDetails emailDetails = new EmailDB().GetEmailDetails(11);
            /* for (int i = 0; i < table.Rows.Count; i++)
            {
               // WebUtils.SendEMail(table.Rows[i].Cells[0], emailDetails.Title, emailDetails.Centent);
                WebUtils.SendEMail("[email protected]", emailDetails.Title, emailDetails.Centent);
            }*/
            new ArticleDB().AddArticle("测试定时器", "测试定时器", 1, DateTime.Now);
            WebUtils.SendEMail("[email protected]", emailDetails.Title, emailDetails.Centent);
        }
        catch
        {
            
        }
        finally
        { 
            table.Clear();
           // table1.Clear();
        }
    }}//Global.asax里是这样写的
private static TimerEmail _token_update_agent = new TimerEmail();
        
    void Application_Start(object sender, EventArgs e) 
    {
        // 在应用程序启动时运行的代码
            _token_update_agent.Initialize();
    }
我跟踪了,这句代码执行了: _timer = new System.Threading.Timer(TimerCallback, null, System.Threading.Timeout.Infinite, Interval * 1000);
为什么TimerCallback(object state)就没执行呢?
初学定时器,做过的帮我看看,vs2005
或者有没有现成的代码供我学习一下啰!先谢了!