Chris R. Timmons <crtimmons@X_NOSPAM_Xcrtimmonsinc.com> wrote:
I'm trying to create a new Hashtable and use it:
System.Collections.Hashtable hash_directory;
hash_directory.Item("blabla");
and here is the error message I get:
'System.Collections.Hashtable' does not contain a definition for
'Item'
any idea??
You must first create an instance of the hashtable before it can be
used:
Hashtable hash_directory = new Hashtable();
While that's true, it's not the reason for the error message. The error
message is because C# doesn't use named properties like that; it uses
the "default" property for a class as an indexer:
object o = hash_directory["blabla"];
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too