Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' This tutorial is provided in part by Server Intellect Web Hosting Solutions http://www.serverintellect.com
' Visit http://www.AspNetTutorials.com for more ASP.NET Tutorials
End Sub
Protected Sub btn_get_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_get.Click
Dim key As Integer
Dim name As String = String.Empty
Dim str As String = String.Empty
Dim hashtable As Hashtable = New Hashtable()
key = 1
name = "Jake"
Hashtable.Add(key, name)
key = 2
name = "peter"
Hashtable.Add(key, name)
key = 3
name = "lily"
Hashtable.Add(key, name)
For Each de As DictionaryEntry In hashtable
str = str + "key=" + CType(de.Key, String) + " " + " value=" + de.Value.ToString() + "<br>"
Next de
Me.Label1.Text = str
End Sub
End Class