VB.Net by API/System.Collections.Generic/KeyValuePair

Материал из VB Эксперт
Перейти к: навигация, поиск

KeyValuePair.Value

<source lang="vbnet"> Imports System.Collections.Generic Public Class GenericTest

  Public Shared Sub Main()
     Dim education As New Dictionary(Of String, String)
     education.Add("BA", "Bachelor of Arts")
     education.Add("BS", "Bachelor of Science")
     education.Add("MA", "Master of Arts")
     education.Add("MS", "Master of Science")
     education.Add("MPhil", "Master of Philosophy")
     education.Add("PhD", "Doctor of Philosophy")
     Console.WriteLine(education.Item("BS"))
     Console.WriteLine()
     For Each pair As KeyValuePair(Of String, String) In education
        Console.WriteLine(pair.Value)
     Next
  End Sub

End Class


 </source>