Question

Answers

Maybe it goes without saying, you can't change your Hashtable while enumerating through it with foreach. It will throw an error. Also, if you are multi-threading, foreach is not threadsafe; you'll need to synchronize your threads and lock access during the whole enumeration (or be prepared to catch an exception).Les Potter, Xalnix Corporation, Yet Another C# Blog

Maybe it goes without saying, you can't change your Hashtable while enumerating through it with foreach. It will throw an error. Also, if you are multi-threading, foreach is not threadsafe; you'll need to synchronize your threads and lock access during the whole enumeration (or be prepared to catch an exception).Les Potter, Xalnix Corporation, Yet Another C# Blog