Hashtable.IsSynchronized Property gets a value indicating whether access to the Hashtable is synchronized (thread safe). : HashTable « Data Structure « VB.Net






Hashtable.IsSynchronized Property gets a value indicating whether access to the Hashtable is synchronized (thread safe).

 

Imports System
Imports System.Collections

Public Class SamplesHashtable    

    Public Shared Sub Main()
        Dim myHT As New Hashtable()
        myHT.Add(0, "zero")
        myHT.Add(1, "one")
        myHT.Add(2, "two")
        myHT.Add(3, "three")
        myHT.Add(4, "four")

        Dim mySyncdHT As Hashtable = Hashtable.Synchronized(myHT)

        If mySyncdHT.IsSynchronized Then
            Console.WriteLine("synchronized")
        Else
            Console.WriteLine("not synchronized")
        End If        
    End Sub
End Class

   
  








Related examples in the same category

1.Hashtable: add,get,count, Dictionary Key and value EnumeratorHashtable: add,get,count, Dictionary Key and value Enumerator
2.Store Environment Variables into a Hash tableStore Environment Variables into a Hash table
3.Create a Hashtable using the default hash code provider and the default comparer.
4.Create a Hashtable using a case-insensitive code provider and a case-insensitive comparer
5.Create a Hashtable using a case-insensitive code provider and a case-insensitive comparer
6.Create a Hashtable using a case-insensitive code provider and a case-insensitive comparer based on the Turkish culture (tr-TR)
7.Create Hashtable class from another dictionary
8.Hashtable.Add Method adds an element with the specified key and value into the Hashtable.
9.Hashtable.Clear Method removes all elements from the Hashtable.
10.Hashtable.Contains Method Determines whether the Hashtable contains a specific key.
11.Hashtable.CopyTo Method copies the Hashtable elements to a one-dimensional Array instance at the specified index.
12.Hashtable.GetEnumerator Method returns an IDictionaryEnumerator that iterates through the Hashtable.
13.Displays the keys and values of the Hashtable using foreach statement
14.Hashtable.Remove Method removes the element with the specified key from the Hashtable.