Mega Code Archive

 
Categories / VB.Net Tutorial / Collections
 

Add value pair to Hashtable and get value back by key

Imports System Imports System.Collections Class Test   Shared Sub Main()     Dim myTable As New Hashtable()     myTable.Item("A") = 1     myTable.Item("B") = 44     myTable.Item("C") = 43     myTable.Item("D") = 33     myTable.Item("E") = 39     Dim Country As String = "C"     Dim Code As Integer = myTable.Item(Country)     Console.WriteLine(Code)   End Sub End Class 43