Mega Code Archive

 
Categories / VB.Net Tutorial / Collections
 

Retrieve single value from Hashtable by key

Option Strict On Imports System.Collections Public Module modMain    Public Sub Main()       Dim airports As New Hashtable       airports.Add("JFK", "John F. Kennedy, New York")       airports.Add("LAX", "Los Angeles International, Los Angeles")       airports.Add("ORD", "O'Hare International, Chicago")       airports.Add("LHR", "Heathrow Airport, London")       Console.WriteLine(airports.Item("JFK"))    End Sub End Module John F. Kennedy, New York