In asp.net2.0 we can easily access the configuration file,. NetFrameWork2.0 adds a new SystemWebSectionGroup class.
Allows users to programmatically access the configuration file's system.web group.
For example, to determine whether the web.config is debug= "true", or to determine the form of authentication
SystemWebSectionGroup ws = new SystemWebSectionGroup ();
Compilationsection CP = Ws.compilation;
With CP. Debug, you can get the configuration on "Debug" in the compilation section
Authenticationsection as = ws. authentication;
With AS. Mode can get the configuration for "mode" in the authentication section, which is one of the Authenticationmode enumerations
The Authenticationmode values are as follows:
Description of Member name
Forms Specifies authentication based on ASP.net forms as an authentication mode.
None does not specify authentication.
Passport specifies Microsoft Passport as the authentication mode.
Windows specifies windows as the authentication mode. This mode is applicable when using the Internet Information Services (IIS) authentication method (Basic, concise, integrated Windows (Ntlm/kerberos), or certificates).
Attached: Public properties of the SystemWebSectionGroup class:
Name Description
Anonymousidentification Gets the anonymousidentification section.
Authentication Gets the authentication section.
Authorization Gets the Authorization section.
Browsercaps Gets the browsercaps section.
ClientTarget Gets the clienttarget section.
Compilation gets the compilation section.
CustomErrors Gets the CustomErrors section.
Deployment gets the deployment section.
Devicefilters Gets the devicefilters section.
Globalization gets the globalization section.
healthmonitoring Gets the healthmonitoring section.