如何听在ASP.NET IIS关闭事件 [英] How to listen to IIS shutdown event in ASP.NET
本文介绍了如何听在ASP.NET IIS关闭事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在刷新自身DB每隔X插入我的ASP.NET静态变量。
问题是,如果我发布应用程序时,IIS进程被终止与我的所有静态材料。
I have in my ASP.NET static variable that flushes itself to DB every X insertions. Problem is, if I publish the application , the IIS process is killed with all my static material.
我如何preserve吗? - 或者我怎么可以刷新一次ASP.NET应用程序关闭
How can I preserve it - or how can I flush it once ASP.NET application is shutting down?
感谢您
推荐答案
Global.asax中
Global.asax
void Application_End(object sender, EventArgs e)
{
// SHUTDOWN CODE HERE
}
这篇关于如何听在ASP.NET IIS关闭事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文