Configuring application parameters using web.config

zhaozj2021-02-16  95

Configuring application parameters using web.config

Author: Luo Huitao

In the ASP.NET application, some system-level parameters, such as database server names, such as database server names. This function can be easily implemented using the web.config file using the XML format. Below is a piece of web.config file:

...

note

It is an ASP.NET predefined section. Among them, any of them can be added.

. When you need to obtain configuration information in your code, you can use the Class in System.Configuration to access, for example:

String foldername = system.configuration.configurationSettings.Appsettings ["logfolder"];

If you need to modify the configuration after the configuration, you can use the notepad to modify the web.config file directly.

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

New Post(0)