Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Question: Does the hashtable class have an item method?

 

All documentation says it should. MSDN says it should, other sources confirm this. But I have not been able to use it, becuase it does not seem to be there !!

 

As I understand it I should be able to just create a hashtable and the method should be available as a member of h, below..

 

System.Collections.Hashtable h = new System.Collections.Hashtable();

 

I'm using C# 2003 and cannot fingure out what is going on. Can anyone shed some light on this?

 

Thanks

Posted

using System.Collections;

Hashtable h = new Hashtable();

h.Add(key, value);
object o = h[key];

 

Should work.

Gamer extraordinaire. Programmer wannabe.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...