web 2.0

VB.NET & HashTable.Clear()

VB.NET & HashTable.Clear() - HashTable.Clear() : Removes all elements from the Hashtable.

ShotDev Focus:
- VB.NET & HashTable.Clear()

Example

AspNetHashtableClear.aspx

  1. <%@ Page Language="VB" %>  
  2. <script runat="server">  
  3. Sub Page_Load(sender As Object, e As EventArgs)  
  4. Dim objHashtable As Hashtable  
  5. Dim i As Integer  
  6. Dim lsItem As String  
  7.   
  8. objHashtable = New Hashtable  
  9.   
  10. objHashtable.Add("white""#FFFFFF")  
  11. objHashtable.Add("black""#000000")  
  12. objHashtable.Add("red""#FF0000")  
  13. objHashtable.Add("yellow""#FFFF00")  
  14. objHashtable.Add("green""#00FF00")  
  15.   
  16. objHashtable.Clear()  
  17.   
  18. For Each lsItem In objHashtable.Keys  
  19. Me.lblText.Text = Me.lblText.Text & "Key = " & lsItem & " , Value = " & objHashtable.Item(lsItem) & "<br>"  
  20. Next  
  21.   
  22. End Sub  
  23. </script>  
  24. <html>  
  25. <head>  
  26. <title>ShotDev.Com Tutorial</title>  
  27. </head>  
  28. <body>  
  29. <form id="form1" runat="server">  
  30. <asp:Label id="lblText" runat="server"></asp:Label>  
  31. <br />  
  32. </form>  
  33. </body>  
  34. </html>  

Screenshot

 VB.NET & HashTable.Clear()
.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (No Ratings Yet)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.