共用方式為


Configuration.SectionGroups 屬性

定義

取得這個組態所定義的區段群組集合。

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

屬性值

ConfigurationSectionGroupCollection 集合,表示這個 Configuration 物件的區段群組集合。

範例

下列程式代碼範例示範如何使用 SectionGroups 屬性。

ConfigurationSectionGroupCollection
    groups = config.SectionGroups;
Console.WriteLine("Groups: {0}", groups.Count.ToString());
foreach (ConfigurationSectionGroup group in groups)
{
    Console.WriteLine("Group Name: {0}", group.Name);
   // Console.WriteLine("Group Type: {0}", group.Type);
}
Dim groups As ConfigurationSectionGroupCollection = config.SectionGroups
Console.WriteLine("Groups: {0}", groups.Count.ToString())
For Each group As ConfigurationSectionGroup In groups
    Console.WriteLine("Group Name: {0}", group.Name)
    ' Console.WriteLine("Group Type: {0}", group.Type);
Next group

備註

組態區段可以合併成群組,以方便起見並新增功能。 SectionGroups存取 屬性,以擷取ConfigurationSectionGroupCollection代表這個Configuration物件的區段群組集合的物件。 如果這個 Configuration 物件代表繼承的檢視,則會傳回區段群組的合併清單。

適用於