更新:2007 年 11 月
命名空间:
System.Configuration 程序集:
System.Configuration(在 System.Configuration.dll 中)
Public ReadOnly Property Sections As ConfigurationSectionCollection
Dim instance As ConfigurationSectionGroup
Dim value As ConfigurationSectionCollection
value = instance.Sections
public ConfigurationSectionCollection Sections { get; }
public:
property ConfigurationSectionCollection^ Sections {
ConfigurationSectionCollection^ get ();
}
/** @property */
public ConfigurationSectionCollection get_Sections()
public function get Sections () : ConfigurationSectionCollection
下面的代码示例演示如何访问 Sections 属性。
Dim sectionCollection _
As ConfigurationSectionCollection = _
sectionGroup.Sections
Dim sectionName As String
For Each sectionName In sectionCollection.Keys
Dim section As ConfigurationSection = _
CType(sectionCollection( _
sectionName), ConfigurationSection)
Console.WriteLine((getSpacer() + _
"Section Name:" + _
section.SectionInformation.Name))
Next sectionName
ConfigurationSectionCollection sectionCollection =
sectionGroup.Sections;
foreach (String sectionName in sectionCollection.Keys)
{
ConfigurationSection section =
(ConfigurationSection)sectionCollection[sectionName];
Console.WriteLine(getSpacer() + "Section Name:"
+ section.SectionInformation.Name);
}
Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
.NET Framework
受以下版本支持:3.5、3.0、2.0
参考