System. Monitoring Aion

Source: Internet
Author: User

Overview of system. Monitoring aion:

The system. Configuration namespace includes the classes used to process configuration files, such as the classes in the operation configuration section, the classes used to obtain database connection strings, and the classes used to provide data verification.

Using the system. Configuration namespace, developers can obtain the configuration file management class "configurationmanager" and use it to dynamically Process configuration files. In the website, the default configuration file name is "Web. config ". In the project, the default configuration file name is "app. config ".

System. Configuration namespace class composition

The Configuration File Stores some basic configurations for running the PlayStation and program. classes in the system. Configuration namespace are responsible for dynamically managing these configurations. The following describes common classes for managing configurations and their descriptions.

 

Configuration File Information: configuration class

The configuration class is the main operation class for reading configuration files. It is the class associated with the Web. confing and App. config configuration files. These configuration files can be dynamically modified through the next class. To use the configuration class, you must first understand the terms of Several configuration files: configuration elements, configuration attributes, and configuration sections. The following code has this member.

<Configsections>

<Section name = "bookversion"> </sectioin>

</Configsections>

"Configsections" is the configuration section, "section" is the configuration element, and "name" is the configuration attribute.

 

<? XML version = "1.0" encoding = "UTF-8"?>

<Configuration>

<Configsections>

<Section name = "student" type = "system. configuration. dictionarysectionhandler"/>

</Configsections>

<Student>

<Add key = "name" value = "http://www.cnblogs.com/i80386/archive/2011/10/27/amily"/>

<Add key = "Age" value = "http://www.cnblogs.com/i80386/archive/2011/10/27/15"/>

<Add key = "sex" value = "http://www.cnblogs.com/i80386/archive/2011/10/27/female"/>

</Student>

</Configuration>

Note: configsections is equivalent to defining variables and must be placed in configuration



Idictionary istudent = (idictionary) configurationmanager. getsection ("student ");

String [] keys = new string [istudent. Keys. Count];

String [] values = new string [istudent. Keys. Count];

Istudent. Keys. copyto (keys, 0 );

Istudent. Values. copyto (values, 0 );

Foreach (var key in keys)

{

Console. writeline (key );

}

Foreach (VaR value in values)

{

Console. writeline (value );

}

Foreach (var key in istudent. Keys)

{

Console. writeline ("{0 }:{ 1}", key, istudent [Key]);

}

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.