Configuration.SectionGroups 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取由此配置定义的节组的集合。
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 对象表示继承的视图,则将返回分区组的合并列表。