c#代码获取web.config配置文件里面设置的 <compilation debug="true"节点的debug值

来源:互联网 发布:urlencoder js 解码 编辑:程序博客网 时间:2024/05/17 01:15
下面代码可以获取掉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

阅读全文
0 0
原创粉丝点击