Return to Snippet

Revision: 12391
at March 12, 2009 17:16 by blackf0rk


Initial Code
' Declaring a generic dictionary; adding values.
' Where the Key and Value (String, String) can be any object.

Dim xGD As New Generic.Dictionary(Of String, String)
xGD.Add("key1", "value1")

' Getting access to a value:

Dim value as String = xGD("key1")

' Looping:

For Each xKVP As Generic.KeyValuePair(Of String, String) In xGD
  Consoe.Writeline(xKVP.Key & ", " & xKVP.Value)
Next

Initial URL
http://codefinds.blogspot.com/2008/12/use-generic-dictionary.html

Initial Description

                                

Initial Title
Use a Generic Dictionary

Initial Tags

                                

Initial Language
VB.NET