停止ASP.NET应用程序的执行 [英] Stop execution of ASP.NET application

查看:248
本文介绍了停止ASP.NET应用程序的执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Application_Start()方法,我怎么能阻止当某些条件不具备的ASP.NET应用程序的执行?

In my Application_Start() method, how can I stop the execution of the ASP.NET application when certain conditions are not met?

抛出异常不出现工作。

推荐答案

我不认为这是可能的;即使你可以'中止'的启动,下一次尝试从网站访问的URL会尝试再次启动

i don't think that's possible; even if you could 'abort' the startup, the next attempt to access a URL from the site would try to start it again

也许是一个静态变量可用于信号走/不走,和begin_request可以重定向到一个占位符页面,而不是?

perhaps a static variable could be used to signal go/no-go, and begin_request could redirect to a placeholder page instead?

这篇关于停止ASP.NET应用程序的执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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