KeyValueConfigurationElement.Key Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the key of the KeyValueConfigurationElement object.
public:
property System::String ^ Key { System::String ^ get(); };
[System.Configuration.ConfigurationProperty("key", DefaultValue="", Options=System.Configuration.ConfigurationPropertyOptions.IsKey)]
public string Key { get; }
public string Key { get; }
[<System.Configuration.ConfigurationProperty("key", DefaultValue="", Options=System.Configuration.ConfigurationPropertyOptions.IsKey)>]
member this.Key : string
member this.Key : string
Public ReadOnly Property Key As String
Property Value
The key of the KeyValueConfigurationElement.
- Attributes
Examples
The following code example demonstrates how to use the Key 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();
}
' Display each KeyValueConfigurationElement.
Dim keyValueElement As KeyValueConfigurationElement
For Each keyValueElement In settings
Console.WriteLine("Key: {0}", keyValueElement.Key)
Console.WriteLine("Value: {0}", keyValueElement.Value)
Console.WriteLine()
Next
Applies to
Collaborer avec nous sur GitHub
La source de ce contenu se trouve sur GitHub, où vous pouvez également créer et examiner les problèmes et les demandes de tirage. Pour plus d’informations, consultez notre guide du contributeur.