[. Net]: Write Data in the custom configuration section

Source: Internet
Author: User

 

Preface:

Data Reading in the custom configuration section. Previously, Xiao Zhu wrote a series of articles.
This article describes how to use program code to write custom configuration data.

 

Note:

In the Microsoft Visual Studio ide debugging environment, when a program is written to. config.
The program will write * .vshost.exe. config instead of *. EXE. config as expected.
After the program is executed, the IDE overwrites * .vshost.exe. config to the status before writing.
Therefore, the program fails to be executed.

 

After compilation, click *. EXE under the bin directory for execution.
Check *. EXE. config again to see the expected results.

 

Related information:

[ASP. NET] write your own configuration section Part 1: http://www.dotblogs.com.tw/regionbbs/archive/2009/05/08/custom_configuration_section_in_web_config.aspx
[ASP. NET] write your own configuration section Part 2: http://www.dotblogs.com.tw/regionbbs/archive/2009/09/17/orgainzeyoursectionintogroupforconfiguration.aspx
[ASP. NET] write your own configuration section Part 3: http://www.dotblogs.com.tw/regionbbs/archive/2009/10/09/customconfigurationelementcollection.aspx

 

Sample program:

Download file: clk.configurationsample.rar

 

Custom configurationsection

 

Set. config

 

Write Program

 

Execution result

 

Postscript:

Custom configuration section,
If the type in the system. Configuration namespace is used as the attribute, it is quite convenient to read and write data.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.