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
GitHub पर हमारे साथ सहयोग करें
इस सामग्री का स्रोत GitHub पर पाया जा सकता है, जहाँ आप समस्याएँ बना और समीक्षा भी कर सकते हैं और अनुरोध खींच सकते हैं. अधिक जानकारी के लिए, हमारे योगदानकर्ता गाइड देखें.