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

xiaoxiao2021-02-28  104

下面代码可以获取掉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

转载请注明原文地址: https://www.6miu.com/read-67443.html

最新回复(0)