This article is a mirror article of machine translation, please click here to jump to the original article.

View: 21703|Reply: 0

[Source] .net/c# to create a custom configuration node

[Copy link]
Posted on 11/2/2018 3:58:02 PM | | | |
In the past, when we configured some variable parameters, we usually wrote them to the appSettings node in web.confg.

demandSet the Redis cache configuration: IP, port, and password

previous practice

Configure under the appSettings node in web.config

We need to create 3 subnodes to write the entire redis configuration. Can you write the redis configuration as a single line configuration file?

Create custom configurations

Create a new RedisConfig.cs file with the following code:



in web.configconfigSections nodeAdd to


in web.configconfiguration nodeAdd to



Get the parameter configuration:



(End)






Previous:Win10 Digital Activation Tool (HWIDGen) v51.15 Chinese version
Next:The PPT template that has been with me for a year, there are 74 sets of deletion and deletion!!
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com