KeyValuePair<TKey,TValue>.Value 속성

정의

키/값 쌍의 값을 가져옵니다.

public:
 property TValue Value { TValue get(); };
public TValue Value { get; }
member this.Value : 'Value
Public ReadOnly Property Value As TValue

속성 값

TValue

KeyValuePair<TKey,TValue>의 값인 TValue입니다.

예제

다음 코드 예제에서는 구조체를 사용하여 KeyValuePair<TKey,TValue> 사전의 키와 값을 열거하는 방법을 보여줍니다.

이 코드는 클래스에 제공된 더 큰 예제의 Dictionary<TKey,TValue> 일부입니다.

// When you use foreach to enumerate dictionary elements,
// the elements are retrieved as KeyValuePair objects.
Console::WriteLine();
for each( KeyValuePair<String^, String^> kvp in openWith )
{
    Console::WriteLine("Key = {0}, Value = {1}",
        kvp.Key, kvp.Value);
}
// When you use foreach to enumerate dictionary elements,
// the elements are retrieved as KeyValuePair objects.
Console.WriteLine();
foreach( KeyValuePair<string, string> kvp in openWith )
{
    Console.WriteLine("Key = {0}, Value = {1}",
        kvp.Key, kvp.Value);
}
' When you use foreach to enumerate dictionary elements,
' the elements are retrieved as KeyValuePair objects.
Console.WriteLine()
For Each kvp As KeyValuePair(Of String, String) In openWith
    Console.WriteLine("Key = {0}, Value = {1}", _
        kvp.Key, kvp.Value)
Next kvp

설명

이 속성은 읽기/전용입니다.

적용 대상