共用方式為


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 物件代表合併的組態,將會傳回區段的合併清單。

適用於