如题ASP.NET中,需要实现这样一个功能:
    管理员根据一个截至日期设定每天向某个员工自动发送邮件功能如何实现?
请讲的具体点,谢谢!~

解决方案 »

  1.   

    global.asax中新开一个线程,循环调用就行了
      

  2.   

    员工信息、邮件地址、截止日期保存在数据库的吧。用个winForm程序,放置一个timer,间隔24小时执行一次。发邮件用System.Net.Mail。
      

  3.   

    你可以写一个windows service
      

  4.   

    这个是要写成windows service的,windows service的实现很简单,你去网上搜一下很多的!
    但是要注意一下那个timer写windows服务的时候,因为服务本身是非FORM的,故 System.Windows.Forms.Timer是无法使用的,但微软公司的VS2005默认却是System.Windows.Forms.Timer,这不能不说是微软给大家开的一个大笑话。如果你在写windows服务的时候,想使用Timer功能,需要用到的是:System.Timers.Timer类参照解决办法如下:(1)在Service1.Designer.cs文件中重新定义timer类:  private System.Timers.Timer timer1;(2)在Service1.Designer.cs文件中重写InitializeComponent方法。private void InitializeComponent()
            {
                this.components = new System.ComponentModel.Container();
                this.timer1 = new System.Timers.Timer(5000);  //间隔为5秒
                this.timer1.AutoReset = true;
                this.timer1.Elapsed += new System.Timers.ElapsedEventHandler(this.timer1_Elapse);
                this.timer1.Enabled = true;        
                this.ServiceName = "xxt_service";
            }(3)  在Service1.cs文件中编写Timer触发事件private void timer1_Elapse(object source, System.Timers.ElapsedEventArgs e)
            {
                string command = "0010561111";
                sw.WriteLine(Timetostr() + ":         校讯通模拟话机定时检测windows服务 外发消息:  " + command);
            } 
      

  5.   

    呵呵,对,
    写window Service的时候小心那个timer.
    刚开始接触.net的时候我就上过当-_-!