Overview
For any web application server, a major requirement is to have rich and flexible configuration systems - making developers to make
The installed application "is easy to contact" Setting Data "without having to set the set value into the program code, and the Administrators can easily adjust
Customize these settings value post-deployment.
The ASP configuration system is committed to meeting these two necessary conditions. To do this, it passes a hierarchical configuration infrastructure so that the extended configuration data can be
Save and run through the entire ASP application. At the same time, ASP provides a rich initial set collection.
The ASP configuration system provides benefits:
1. The configuration information is stored in an XML-based configuration file. Administrators and developers can use any standard text editor, XML parser, or perl script
Interpretation and update configuration settings.
2. The configuration information is stored in a file, which is placed under the same directory tree as the application. This makes the ASP app very easy to install,
Just use XCOPY or FTP.
3, the configuration system is easy to expand. You can store your own configuration criteria and settings in the configuration system.
4. Changes to the ASP configuration file are automatically detected by the system and is submitted without user interference. System administrators do not need to deactivate the system to let change
effect.
5. The configuration information is submitted to the application. Subdatalog inherits or covers the configuration settings from the parent directory. This allows different applications or individual applications
Different parts have different settings.
Config.Web configuration file
All ASP configuration information is included in the configuration file called Config.Web. The following example illustrates the structure of an ASP configuration file:
Code:
-------------------------------------------------- ------------------------------
Type = "system.web.config.httpmodulesconfighandler" /> Type = "system.web.config.httphandlerconfighandler" /> TYPE = "System.Web.config.SessionStateConfighandler" /> TYPE = "system.web.config.globalizationconfighandler" />
Here -> configsections> httpmodules> > configure> -------------------------------------------------- ------------------------------ All configuration information must be between the The handler declaration (including in the Chu, their submerses have been removed). Note that every configuration subsection below must have a statement in The configuration section name is given and NGWS framework assembly and classes that will handle their configuration information. Each configuration section contains ASP fine Section Configure the set child elements. These concepts are illustrated by the following code: Code: -------------------------------------------------- ------------------------------ TYPE = "System.Web.config.singletagSectionHandler" /> TYPE = "System.Web.config.singletagSectionHandler" /> TYPE = "system.web.ui.assembliess" /> TYPE = "System.Web.config.SecurityConfighandler" /> configsections> Assembly = "system.drawing.dll" /> configure> -------------------------------------------------- ------------------------------ This example illustrates a configuration file that contains four configuration sections - DebugMode, Globalization, Assemblies, and Security. Below is the established setting: * In the DEBUG section, the debug mode is opened (set to TRUE). * In the Globalization Section, the request (RESPONSE) encoding is set. * In the Assemblies section, four Assemblie have been added. * In the Security section, all users are given access. Hierarchical configuration system We have placed, and there are multiple profiles available in different directories on the server. When the request for a detailed URL arrives, the ASP calculates the URL in the layer. Settings in the secondary structure and use the configuration files located in the path for the requested URL. For example, the structure of a site is as follows: Application root | ----- Subdir1 | ----- Subdir2 The idea is that the configuration of the configuration application allows all users to access the Application Root, enabling the selected users to access two A child directory. Now suppose there is a config.web file in the directory SubDir1, there is no config.Web file in Application root and subDir2. In this case Two config.Web files are used. The highest level of config.Web file is located in the% windir% / complus / version directory, which is installed with the NGWS SDK Come, contain the default setting. This file is considered to be in the machine level, all ASP directories and subdirectories have inherited their settings. The default security of this file The setting of the section is to allow access to all users. When the Application root directory in the example does not exist, that is, when this set value is not edited, all Users will allow access to this directory because this directory inherits the settings of the machine level profile. If the config.web file in the subdir1 directory contains one Safety configuration section, it is set to only allow some users to access the directory, then the subdir2 directory will inherit its settings, but the Application root directory is not subject to influences. Therefore, all users can access the Application root directory, but only some users can access two subdirectories. Standard configuration setting The ASP environment comes with a standard config.Web file that contains a rich configuration setting collection. This file is located % windir% / complelus / version directory. In the configuration file of Machine Level (machine-level), we can find below the ASP standard configuration section. To standard configuration section. Sunadm @ 2k1020 -------------------------------------------------- ------------------------------ author: SunADM