Painfully obvious/non-obvious things...
So I spent 10 minutes yesterday looking in Help and Google searching for a way to access the value in a Hashtable object by its key. I've done it before, and I'm not stupid about these things, and its embarassing, frankly.
The Help tells you how to add stuff to the Hashtable (ie. myHashTable.Add(key, value)) and see if the key is in the hash table (myHashTable.ContainsKey(testkey)), but it doesn't show you in the examples how to get the actual value out. There is the Keys and Values collections that you can iterate through, but I know there's an easier way than that.
Finally I'm back to VS.NET and the Intellisense and I'm thinking “ok, it must be some sort of array-like accessor, maybe a ( ...? nope. maybe a [ ... aha! that's it!“).
if (myHashtable.ContainsKey(myKey))
{
myValue = (string)myHashtable[myKey];
}
Hooray for Intellisense.
That's 10 minutes I'll never get back. And now the three people who might read my blog knows that sometimes I feel like a complete idiot.