c#代码获取web.config配置文件里面设置的 <compilation debug="true"节点的debug值
2017-09-01 10:08
1236 查看
下面代码可以获取掉debug的值
System.Web.Configuration.CompilationSection cmp = (System.Web.Configuration.CompilationSection)System.Configuration.ConfigurationManager.GetSection("system.web/compilation"); if (!cmp.Debug) { filterContext.ExceptionHandled = true; }
这里有CompilationSection 类的介绍,微软官方的地址:
https://msdn.microsoft.com/zh-cn/library/system.web.configuration.compilationsection(v=vs.80).aspx
相关文章推荐
- c# 根据配置文件路径,设置和获取config文件 appSettings 节点值
- [C#]使用 C# 代码实现拓扑排序 dotNet Core WEB程序使用 Nginx反向代理 C#里面获得应用程序的当前路径 关于Nginx设置端口号,在Asp.net 获取不到的,解决办法 .Net程序员 初学Ubuntu ,配置Nignix 夜深了,写了个JQuery的省市区三级级联效果
- 在Asp.Net2.0中可以方便的访问配置文件web.config,如判断debug设置,验证类型等。
- ASP.NET项目中的web.config文件里配置数据库连接并在程序代码中获取连接字符串
- C#获取web.config配置文件内容
- C#获取web.config配置文件内容的方法
- C#获取web.config配置文件内容
- 如何获取配置文件Web.config的AppSetting节点数据
- C#获取web.config配置文件内容
- C#获取web.config配置文件内容
- C#获取web.config配置文件内容
- Web.Config中的<compilation debug="true"/>
- C# VS2010发布问题---<compilation debug="true" targetFramework="4.0">
- C#获取web.config配置文件内容
- 在ASP.NET项目中的web.config文件里配置数据库连接并在程序代码中获取连接字符串
- 关于web.config配置文件里面的 mode的各种含义,mode="RemoteOnly",mode="On",mode="Windows"
- C#获取web.config配置文件内容
- 只有在配置文件或 Page 指令中将 enableSessionState 设置为 true 时,才能使用会话状态。还请确保在应用程序配置的 <configuration>\<system.web>\
- C#获取web.config配置文件内容
- 在Asp.Net2.0中可以方便的访问配置文件web.config,如判断debug设置,验证类型等。