ElementInformation.IsPresent Property
.NET Framework (current version)
Gets a value indicating whether the associated ConfigurationElement object is in the configuration file.
Assembly: System.Configuration (in System.Configuration.dll)
Property Value
Type: System.Booleantrue if the associated ConfigurationElement object is in the configuration file; otherwise, false.
The following example shows how to use the IsPresent property.
Public Shared Sub IsElementPresent() ' 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 isPresent As Boolean = _ url.ElementInformation.IsPresent Console.WriteLine("Url element is present? {0}", _ isPresent.ToString()) End Sub 'IsElementPresent
.NET Framework
Available since 2.0
Available since 2.0
Show: