In. NET, because a different node corresponds to a class to handle it. NET inside for convenience, has built up some classes for us to use, so that when we read the configuration file, we do not have to define the class to handle their own defined custom nodes. Below we have written a configuration file: <?xml version= "1.0" encoding= "Utf-8"?><configuration> <configSections> <!-- Use ignoresection to handle custom nodes-<!--<section name= "mailserveraddress" &
1.. net--using. Net built-in handlers to handle custom nodes demo
Summary: In. NET, because of the different nodes, the corresponding class to handle it,. NET inside for convenience, has built up some classes for us to use, so that when we read the configuration file, we do not have to define the class to handle their own defined custom nodes. Here we write a configuration file:--the node name is: MailServe
2.. net--implements the IConfigurationSectionHandler interface definition handler to handle the custom node
Summary: In addition to using the built-in handlers provided in. NET to handle our custom nodes, we can also use a variety of methods to define processing classes to handle our custom nodes, this article mainly introduces the way to implement a custom handler by implementing the IConfigurationSectionHandler interface. First, let's write the following custom node in the config file: 13232@qq.com LHC
3.. Net configuration file--Inherit configurationsection implement custom processing class handle custom Configuration node
Summary: In addition to using inherited IConfigurationSectionHandler methods to define classes that handle custom nodes, you can also achieve the same effect by inheriting the ConfigurationSection class. First of all. NET configuration file: When you configure a node, there are two ways to store the parameter data: one that is stored in the attributes of the node, and the other stored in the text of the node. Because a node can have a lot
4.. NET configuration file--Unified node configuration management
Introduction: For. NET, if you want to handle it separately, add a specified class for this node, and if we define many custom nodes in an application, then by doing so, there will be a lot more processing classes, in order to avoid too many classes, We specify a custom node as a portal for all custom nodes, and then write only one processing class, which is the portal and reads the other nodes.