如何在我的应用程序在IIS 7.0中集成模式从ASP.NET页面中运行检测编程 [英] How to programatically detect if my application is running in IIS 7.0 Integrated mode from within an ASP.NET page

查看:240
本文介绍了如何在我的应用程序在IIS 7.0中集成模式从ASP.NET页面中运行检测编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一般来说,我们应该有我们的AppPools的控制权,并且能够强制托管管道模式。在我来说,我没有控制以及想实现后面的代码稍有不同基础上,托管管道模式(集成VS经典)的代码。我只是不知道如何检测这一点。 ?有没有一种简单的方法来从页面后面的代码中做到这一点。

Generally we should have control of our AppPools and be able to force the Managed Pipeline Mode. In my case I don't have control and would like to implement the code behind code a little differently based on the Managed Pipeline Mode (Integrated vs Classic). I just don't know how to detect this. Is there a simple way to do it from within the code behind page?

推荐答案

看的 ApplicationPool.ManagedPipelineMode 和的 ServerManager.ApplicationPools 属性。所以,你可以检查有关类似的 ApplicationPool.ManagedPipelineMode =http://msdn.microsoft.com/en-us/library/microsoft.web .administration.applicationpooldefaults.aspx相对=nofollow>此内容例子做,但要做到这一点您的应用程序的ApplicationPool而不是像例子中的默认应用程序域做的。在 ServerManager.ApplicationPools 包含所有池,包括你的。

Look at ApplicationPool.ManagedPipelineMode and ServerManager.ApplicationPools Properties. So you can examine ApplicationPool.ManagedPipelineMode of the current AppPool about like this example do, but to do this for ApplicationPool of your application and not for the default application domain like the example do. The ServerManager.ApplicationPools contain all pools including yours one.

这篇关于如何在我的应用程序在IIS 7.0中集成模式从ASP.NET页面中运行检测编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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