ElementInformation Class
.NET Framework 2.0
Note: This class is new in the .NET Framework version 2.0.
Contains meta-information about an individual element within the configuration. This class cannot be inherited.
Namespace: System.Configuration
Assembly: System.Configuration (in system.configuration.dll)
Assembly: System.Configuration (in system.configuration.dll)
The following code example shows how to get the ElementInformation associated with a ConfigurationElement object.
Public Shared Function GetElementInformation() _ As ElementInformation ' Get the current configuration file. Dim config _ As System.Configuration.Configuration = _ ConfigurationManager.OpenExeConfiguration( _ ConfigurationUserLevel.None) ' Get the section. Dim section As UrlsSection = CType( _ config.GetSection("MyUrls"), UrlsSection) ' Get the element. Dim url As UrlConfigElement = _ section.Simple Dim eInfo As ElementInformation = _ url.ElementInformation Return eInfo End Function 'GetElementInformation
The following excerpt shows the configuration used by the previous code example.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="MyUrls" type="Samples.AspNet.UrlsSection,
ConfigurationElement, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null" allowDefinition="Everywhere"
allowExeDefinition="MachineToApplication"
restartOnExternalChanges="true" />
</configSections>
<MyUrls name="MyFavorites">
<simple name="Contoso" url="http://www.contoso.com" port="8080" />
<urls>
<clear />
<add name="Microsoft" url="http://www.microsoft.com" port="0" />
</urls>
</MyUrls>
</configuration>
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Community Additions
ADD
Show: