目的:间隔一段时间执行 AutoMakeHtml a = new AutoMakeHtml();代码<%@ Application Language="C#" %>
<%@ Import Namespace="System.Timers" %>
<script runat="server"> void Application_Start(object sender, EventArgs e)
{
//在应用程序启动时运行的代码 System.Timers.Timer myTimer = new System.Timers.Timer(600000);
myTimer.Elapsed += new System.Timers.ElapsedEventHandler(OnTimedEvent);
myTimer.Interval = 600000;
myTimer.Enabled = true;
}
void Application_End(object sender, EventArgs e)
{
//在应用程序关闭时运行的代码 }
void Application_Error(object sender, EventArgs e)
{
//在出现未处理的错误时运行的代码 } void Session_Start(object sender, EventArgs e)
{
//在新会话启动时运行的代码 } void Session_End(object sender, EventArgs e)
{
//在会话结束时运行的代码。
// 注意: 只有在 Web.config 文件中的 sessionstate 模式设置为
// InProc 时,才会引发 Session_End 事件。如果会话模式
//设置为 StateServer 或 SQLServer,则不会引发该事件。 }
private static void OnTimedEvent(object source, System.Timers.ElapsedEventArgs e)
{
AutoMakeHtml a = new AutoMakeHtml();
}
</script>
请看一下我的程序哪里有问题!
<%@ Import Namespace="System.Timers" %>
<script runat="server"> void Application_Start(object sender, EventArgs e)
{
//在应用程序启动时运行的代码 System.Timers.Timer myTimer = new System.Timers.Timer(600000);
myTimer.Elapsed += new System.Timers.ElapsedEventHandler(OnTimedEvent);
myTimer.Interval = 600000;
myTimer.Enabled = true;
}
void Application_End(object sender, EventArgs e)
{
//在应用程序关闭时运行的代码 }
void Application_Error(object sender, EventArgs e)
{
//在出现未处理的错误时运行的代码 } void Session_Start(object sender, EventArgs e)
{
//在新会话启动时运行的代码 } void Session_End(object sender, EventArgs e)
{
//在会话结束时运行的代码。
// 注意: 只有在 Web.config 文件中的 sessionstate 模式设置为
// InProc 时,才会引发 Session_End 事件。如果会话模式
//设置为 StateServer 或 SQLServer,则不会引发该事件。 }
private static void OnTimedEvent(object source, System.Timers.ElapsedEventArgs e)
{
AutoMakeHtml a = new AutoMakeHtml();
}
</script>
请看一下我的程序哪里有问题!
解决方案 »
- 百姓网那种不同类型信息显示不同页面
- 从数据库提数据显示在label上的问题
- JS 纠错 在线等
- 【基础向】在HTML页面如何输出标准的xml
- 再贴!谁来拯救一下这个问题,向数据库添加记录
- 如何将已经调试好的ASP.NET WEB应用程序进行打包?
- 如何在asp.net打开一个Excel模板文件填充数据另存为一个文件然后再打印(客服端)?
- 在ASP.Net开发中,我想自己写程序解析 <httpHandlers>元素,可以实现吗?如何实现?
- 如何在ContentPage中访问MaterPage中的控件?
- 一个dataset返回值问题。
- 如何在JS中调用通用类Utitly中的方法?
- 正则表达式请教,过滤所有标记中的事件代码,因事件中可能出现JS脚本。
void Application_Start(object sender, EventArgs e)
{
//在应用程序启动时运行的代码 System.Timers.Timer myTimer = new System.Timers.Timer(600000);
myTimer.Elapsed += new System.Timers.ElapsedEventHandler(OnTimedEvent);
myTimer.Interval = 600000;
myTimer.Enabled = true;
myTimer.Start();
}