How to write your own configuration in App.config

In one of my C # applications, I need to write the directory path inside the configuration file, as shown below:

Main Folder = Sites Sub Folders = 400, 500, 600, and so on For each subfolders = Inst, Prof 

There are several files inside Inst and Prof.

Inside my program, I have to get all sites (400, 500, etc.), and then I have to write a cycle for all sites for both folders (Inst and Prof) one after the other, after DONE then goes to the next site and so on on

What is the best way to write the folder structure above in the App.config file?

+1
source share
2 answers

You should check out the three-part series of Jon Rista for the .NET 2.0 configuration on CodeProject.

Highly recommended, well written and very helpful! This will give you a complete overview of the .NET configuration system.

To create your own section, there is also a convenient tool (Visual Studio add-in) called Configuration Section Designer , which will make it very easy and simple to create your own section and create all the necessary code for it to process this custom section.

+4
source

There is an easy way to create a custom configuration. custom-configuration-sections-in-3-easy-steps

0
source

Source: https://habr.com/ru/post/1388109/


All Articles