Configuration.Sections 属性

定义

获取此 Configuration 对象定义的节的集合。

public:
 property System::Configuration::ConfigurationSectionCollection ^ Sections { System::Configuration::ConfigurationSectionCollection ^ get(); };
public System.Configuration.ConfigurationSectionCollection Sections { get; }
member this.Sections : System.Configuration.ConfigurationSectionCollection
Public ReadOnly Property Sections As ConfigurationSectionCollection

属性值

Configuration 对象定义的节的集合。

示例

以下示例演示如何检索 Sections 属性值并显示集合中节的编号。

ConfigurationSectionCollection
    sections = config.Sections;
Console.WriteLine("Sections: {0}", sections.Count.ToString());
Dim sections As ConfigurationSectionCollection = config.Sections
Console.WriteLine("Sections: {0}", sections.Count.ToString())

注解

Sections访问 属性以检索ConfigurationSectionCollection表示此Configuration对象的节集合的对象。 如果此 Configuration 对象表示合并的配置,则将返回合并的节列表。

适用于