有没有什么“好”的方法可以通过使用 WebConfigurationManager 来读取 IIS7 的配置节组?我试图阅读授权部分,但 WebConfigurationManager.GetSection() 返回一个“IgnoredSection”实例。这就是我的代码的样子......
authSection = WebConfigurationManager.GetSection("system.webServer/security/authorization", HttpContext.Current.Request.Path)