Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Hash As New Hashtable()
Hash.Add("1", "Jim Strong")
Hash.Add("2", "Mari Anthem")
Hash.Add("3", "Pauly Day")
Hash.Add("4", "George Set")
If Hash.ContainsKey(TextBox1.Text) Then
Label1.Text = Hash.Item(TextBox1.Text)
Else
Label1.Text = "Not in Hashtable"
End If
End Sub
Dim Hash As New Hashtable()
Hash.Add("1", "Jim Strong")
Hash.Add("2", "Mari Anthem")
Hash.Add("3", "Pauly Day")
Hash.Add("4", "George Set")
If Hash.ContainsKey(TextBox1.Text) Then
Label1.Text = Hash.Item(TextBox1.Text)
Else
Label1.Text = "Not in Hashtable"
End If
End Sub
Dim Hash As New Hashtable()
Hash.Add("1", "Jim Strong")
Hash.Add("2", "Mari Anthem")
Hash.Add("3", "Pauly Day")
Hash.Add("4", "George Set")
If Hash.ContainsKey(TextBox1.Text) Then
Label1.Text = Hash.Item(TextBox1.Text)
Else
Label1.Text = "Not in Hashtable"
End If
End Sub
(04-01-16, 01:06 AM)khodor1985 كتب : ضع مثالا لو سمحتProtected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Hash As New Hashtable()
Hash.Add("1", "Jim Strong")
Hash.Add("2", "Mari Anthem")
Hash.Add("3", "Pauly Day")
Hash.Add("4", "George Set")
If Hash.ContainsKey(TextBox1.Text) Then
Label1.Text = Hash.Item(TextBox1.Text)
Else
Label1.Text = "Not in Hashtable"
End If
End Sub
