当应用程序强制结束时,ASP.Net应用程序数据未更新 [英] ASP.Net Application Data not updating when application forcibly end

查看:192
本文介绍了当应用程序强制结束时,ASP.Net应用程序数据未更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有asp.net应用程序.我强行结束此应用程序,并希望在此时间更新数据库中的视图页面计数值.我强行停止我的应用程序,直到Application_End()无法启动.当我正常停止进程时,将触发Application_End()事件.但我的要求是,在两种情况下都应强制或优雅地停止应用程序更新数据.建议我提供更好的解决方案或我应该使用其他事件.

I have asp.net application. I am forcibly end this application and on the time of that i want to update my view page count value in database. I am forcibly stopping my application that time Application_End() not firing. when i stop process normally then Application_End() event fired. but my requirement is that, data should be update in both cases forcibly or gracefully stop application. Suggest me for better solution or what other event should i use.

推荐答案

正如您已经被告知的那样,当您强行关闭它时,代码将无法运行,您实际上已将其杀死.因此,shut_down代码将不会执行.这个故事的寓意是不要杀死这个过程.
As you''ve already been told, when you forcibly shut it down the code will not run, you have killed it essentially. So the shut_down code will not execute. Moral of the story is don''t kill the process.


这篇关于当应用程序强制结束时,ASP.Net应用程序数据未更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆