web.config读取

来源:互联网 发布:moment.min.js 编辑:程序博客网 时间:2024/05/09 18:01

读取authentication

AuthenticationSection authorizationSection= (AuthenticationSection)WebConfigurationManager.GetSection("system.web/authentication");

 

 

读取location下节点

Configuration config = WebConfigurationManager.OpenWebConfiguration("~");

//foreach

ConfigurationLocation myLocation = config.Locations[0];
Configuration myLocationConfiguration = myLocation.OpenConfiguration();
AuthorizationSection authorizationSection1 = (AuthorizationSection)myLocationConfiguration.GetSection("system.web/authorization");

原创粉丝点击