关于ASP.NET定时器的问题 我想每天半夜自动生成静态页面。怎么实现这个方法。那位高手知道,请赐教下。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 写服务或者用开源的调度框架Quartz.net建议用后者,后者提供比较灵活的定时设置,优雅的接口设计。并提供cronExpress表达式来设计定时时间 让程序定时执行,用计划任务也可使用windows服务类public class 服务类 : System.ServiceProcess.ServiceBase { private System.Timers.Timer timer1; private void InitializeComponent() { this.timer1 = new System.Timers.Timer(); ((System.ComponentModel.ISupportInitialize)(this.timer1)).BeginInit(); this.timer1.Interval = 15000; this.timer1.Elapsed += new System.Timers.ElapsedEventHandler(this.timer1_Elapsed); this.ServiceName = "Service1"; ((System.ComponentModel.ISupportInitialize)(this.timer1)).EndInit(); } } 用Timer类,该类的具体用法可以参考msdn. 求助:拼接SQL字符串的问题 进行什么操作,能自动生成***.web.g.cs文件? GridView导出Excel问题 请教大家BS版进销存中关于明细单显示的设计(ASP.NET) AJAX内容显示时,在查看源文件中不能看到这些内容。 请求急救.....控件不显示数据 TextBox1.Text显示不出数据。。。。帮帮忙...没分了 购买虚拟主机的问题 挑花眼了 大家来看看 新手求助~~ 表单中一个控件如何获取另一控件的值? 由於DataGrid分頁,而引起“增加記錄”的問題?(明天就要交差,請大家幫幫手!) GridView 添加数据 如何阻止垃圾邮件?
也可使用windows服务类
public class 服务类 : System.ServiceProcess.ServiceBase
{
private System.Timers.Timer timer1;
private void InitializeComponent()
{
this.timer1 = new System.Timers.Timer();
((System.ComponentModel.ISupportInitialize)(this.timer1)).BeginInit();
this.timer1.Interval = 15000;
this.timer1.Elapsed += new System.Timers.ElapsedEventHandler(this.timer1_Elapsed); this.ServiceName = "Service1";
((System.ComponentModel.ISupportInitialize)(this.timer1)).EndInit(); }
}