Max*_*ean 10 asp.net iis-7 configurationsection
是否有任何"好的"方法通过使用WebConfigurationManager来读取IIS7的配置节组?我试图读取授权部分,但WebConfigurationManager.GetSection()返回一个'IgnoredSection'实例.这就是我的代码看起来像......
authSection = WebConfigurationManager.GetSection("system.webServer/security/authorization", HttpContext.Current.Request.Path)
Run Code Online (Sandbox Code Playgroud)
Configuration webConfig = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
ConfigurationSection cs = webConfig.GetSection("system.webServer");
if (cs != null)
{
XDocument xml = XDocument.Load(new StringReader(cs.SectionInformation.GetRawXml()));
...
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4396 次 |
| 最近记录: |