Web.config file details

xiaoxiao2021-03-14  188

A) .Web.config is stored in XML file specification storage, and the configuration file is divided into the following format.

1. Configure the section handler declaration

Features: Located on the top of the configuration file, included in the flag.

2. Specific application configuration

Features: Located in . You can define information such as global constant settings for the application.

3. Configuration section settings

Features: Located in the section, control the ASP.NET runtime behavior.

4. Configuration group group

Features: Use the tag, you can customize the group, you can put it in inside or other tag.

(2) Each section of the configuration festival

1. Festival

Root elements, other sections are in its interior.

2. Festival

This section is used to define an application setting item. For some uncertain settings, you can also set yourself according to your actual situation

usage:

I.

Define a connection string constant, and can modify the connection string when actual application, and do not modify the program code.

II.

Define an error redirection page.

3. Festival

format:

DefaultLanguage = "C #"

Debug = "True"

/>

I.default language: Defines the background code language to select C # and VB.NET.

Itembug: When True, start ASPX debugging; do not start ASPX debugging for False, so it can improve the application operation

Performance. The general programmer is set to TRUE at the time of development and set to false when handed over to the customer.

4. Festival

format:

Mode = "removeonly"

DefaultRedirect = "Error.aspx"

/>

I.Mode: Have ON, OFF, REMOTEONLY 3 states. ON indicates that custom information is always displayed; OFF means that the detailed ASP.NET error message is always displayed; Remoteonly represents only user display custom information on the local Web server.

Ii.defaultRedirect: URL address redirected when an error occurs. Is optional

III.StatusCode: Indicates the error status code indicating a specific error.

Iv. Redirect: Error redirected URL.

5. Festival

format:

RequestentEncoding = "UTF-8"

ResponseEncoding = "UTF-8"

FileEnCoding = "UTF-8"

/>

I.Requestencoding: It is used to check each request code.

Ii.ResponseEncoding: Used to check the response content encoding sent back.

Iii.fileEncoding: Used to check the default encoding for file resolution of ASPX, ASAX.

6. Festival

format:

Mode = "inproc"

StateConnectionstring = "TCPIP = 127.0.0.1: 42424"

SqlConnectionstring = "Data Source = 127.0.0.1; trusted_connection = yes"

Cookieles = "false"

TIMEOUT = "20"

/>

I.Mode: Several states divided into OFF, Inproc, Stareserver, SQLServer

This property is described in detail here:

http://blog.9cbs.net/chengking/archive/2005/10/27/518079.aspx

Ii. StateConnectionstring: Specifies the server name of the ASP.NET application stores the remote session status, the default is the unit

III.SQLCONNECTIONSTRING: When using a session status database, set the connection string here.

IV. Cookieles: When set to TRUE, it means that the Cookie session status is not used to identify the customer; otherwise, the opposite.

V. Timeout: The time used to define the session status storage, exceed the deadline, will automatically terminate the session.

7. Festival

format:

I.Windows: Using IIS Verification Method

Ii.Forms: Use a form-based verification method

III.passport: Pedpeport cookie verification mode

Iv.none: No verification method

Inside the properties of the Forms node inside:

I.Name: Specifies the name of the HTTP cookie that completes authentication.

Ii.loginURL: If you do not retrieve the page URL of the validation or timeout, it is generally logged in to log in.

III.Protection: Specifies how to protect the cookie data.

Can be set to: All None Encryption Validation Four Protection Methods

a. all represents encrypted data and performs two ways of validity verification.

b. None means not protecting the cookie.

c. Encryption represents encryption of cookie content

d. Validation indicates validity verification for cookie content

Iv. Timeout: Specifies the failure time of the cookie. After the timeout is logged in.

转载请注明原文地址:https://www.9cbs.com/read-129324.html

New Post(0)