T Thomas Wang Aug 8, 2003 #1 i declare a hashtable in c#, i can not find "hashtable.item" property as the specification declared, What i can do? B.Rgds
i declare a hashtable in c#, i can not find "hashtable.item" property as the specification declared, What i can do? B.Rgds
J Jon Skeet Aug 8, 2003 #2 Thomas Wang said: i declare a hashtable in c#, i can not find "hashtable.item" property as the specification declared, What i can do? Click to expand... It's an indexer - you need to use the indexer syntax: Hashtable foo = new Hashtable(); foo["hello"]="there"; // Effectively foo.set_Item("hello", "there") Console.WriteLine (foo["hello"]); // Using foo.get_Item("hello")
Thomas Wang said: i declare a hashtable in c#, i can not find "hashtable.item" property as the specification declared, What i can do? Click to expand... It's an indexer - you need to use the indexer syntax: Hashtable foo = new Hashtable(); foo["hello"]="there"; // Effectively foo.set_Item("hello", "there") Console.WriteLine (foo["hello"]); // Using foo.get_Item("hello")