asp.net中,定时发送邮件如何实现? 如题ASP.NET中,需要实现这样一个功能: 管理员根据一个截至日期设定每天向某个员工自动发送邮件功能如何实现?请讲的具体点,谢谢!~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 global.asax中新开一个线程,循环调用就行了 员工信息、邮件地址、截止日期保存在数据库的吧。用个winForm程序,放置一个timer,间隔24小时执行一次。发邮件用System.Net.Mail。 你可以写一个windows service 这个是要写成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); } 呵呵,对,写window Service的时候小心那个timer.刚开始接触.net的时候我就上过当-_-! ContextMenuStrip(动态为右键弹出菜单添加二级菜单),谢谢!!! 数据库中怎么去掉字符的格式! DXTB编辑器的问题,奇怪?不能编写? 我是新手,如何查看ASP的源代码? 如何将从数据库中读出的数据绑定到DropDownList上? [50分]谁能把宝玉的多级无联动做成.net控件阿? 菜鸟的问题 报错"必须声明变量" 到底是用session还是用cookie????(分)========在线等========= 求教:关于一个服务器设置的问题 网页中播放视频的问题 怎样在C#代码的运行中,弹出confirm窗口,然后得到确认的值,然后再向下继续执行其他代码?
但是要注意一下那个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);
}
写window Service的时候小心那个timer.
刚开始接触.net的时候我就上过当-_-!