Use a Generic Dictionary


/ Published in: VB.NET
Save to your folder(s)



Copy this code and paste it in your HTML
  1. ' Declaring a generic dictionary; adding values.
  2. ' Where the Key and Value (String, String) can be any object.
  3.  
  4. Dim xGD As New Generic.Dictionary(Of String, String)
  5. xGD.Add("key1", "value1")
  6.  
  7. ' Getting access to a value:
  8.  
  9. Dim value as String = xGD("key1")
  10.  
  11. ' Looping:
  12.  
  13. For Each xKVP As Generic.KeyValuePair(Of String, String) In xGD
  14. Consoe.Writeline(xKVP.Key & ", " & xKVP.Value)
  15. Next

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.