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 对象表示合并的配置,则将返回合并的节列表。

适用于

产品 版本
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9