KeyValueConfigurationElement.Value Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the value of the KeyValueConfigurationElement object.

Namespace:   System.Configuration
Assembly:  System.Configuration (in System.Configuration.dll)

[ConfigurationPropertyAttribute("value", DefaultValue = "")]
public string Value { get; set; }

Property Value

Type: System.String

The value of the KeyValueConfigurationElement.

The following code example demonstrates how to use the Value property. This code example is part of a larger example provided for the KeyValueConfigurationCollection class overview.

// Display each KeyValueConfigurationElement.
foreach (KeyValueConfigurationElement keyValueElement in settings)
{
  Console.WriteLine("Key: {0}", keyValueElement.Key);
  Console.WriteLine("Value: {0}", keyValueElement.Value);
  Console.WriteLine();
}

.NET Framework
Available since 2.0
Return to top
Show: