配置asp.net在IIS上的每个应用程序启动之前启动一个方法 [英] configuring asp.net to start a method before each application start on IIS

查看:173
本文介绍了配置asp.net在IIS上的每个应用程序启动之前启动一个方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以配置IIS启动每个asp.net的应用程序之前启动一个方法(我定义它)?

how I Can Configure IIS to start a method (I define it) before starting each asp.net's application on it?

我只是想做某事与IIS (而不是每个应用程序),以便任何在服务器上启动的应用程序执行我定义的方法。事实上我想创造一个威胁做某事。例如我可以在asp.net应用程序中创建这个威胁,但当IIS关闭这个威胁也将关闭。现在我想确保在任何时间这种威胁正在运行(一个或多个这种威胁的实例)。和IIS版本是6。

i just want to do someting with IIS (not each application) so that any application that starts on Server executes a method that i Defined it. in fact i want to create a threat that do something. for example i can create this threat in a asp.net application but when IIS shuts down this threat too will shut down. now i want sure at any time this threat is running (one or more instances of this threat). and IIS version is 6.

推荐答案

您可以使用Global.asax文件并将您的代码放在每个ASP.Net应用程序的Application_Start()方法,当第一个请求进入应用程序时,它将运行一次。

You can use the Global.asax file and put your code in the Application_Start() method of each ASP.Net application, which will run it once when the first request comes in to the application.

我不完全清楚这是否回答了您的问题。你能更具体地说明你想要做什么吗?

I'm not entirely clear if this answers your question. Can you be a bit more specific on what you're trying to do?

这篇关于配置asp.net在IIS上的每个应用程序启动之前启动一个方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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