Click here to Skip to main content
15,910,009 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# .NET question Pin
Christian Graus16-Jul-02 12:32
protectorChristian Graus16-Jul-02 12:32 
GeneralRe: C# .NET question Pin
Eric Gunnerson (msft)17-Jul-02 12:49
Eric Gunnerson (msft)17-Jul-02 12:49 
GeneralRe: C# .NET question Pin
Christian Graus17-Jul-02 13:07
protectorChristian Graus17-Jul-02 13:07 
GeneralRe: C# .NET question Pin
Eric Gunnerson (msft)17-Jul-02 13:38
Eric Gunnerson (msft)17-Jul-02 13:38 
GeneralRe: C# .NET question Pin
Feng Qin16-Jul-02 15:09
Feng Qin16-Jul-02 15:09 
GeneralCollections and Controls Pin
Paul Selormey15-Jul-02 18:50
Paul Selormey15-Jul-02 18:50 
GeneralIterate and modify Pin
J. Ehrnström15-Jul-02 14:10
J. Ehrnström15-Jul-02 14:10 
GeneralRe: Iterate and modify Pin
James T. Johnson15-Jul-02 14:29
James T. Johnson15-Jul-02 14:29 
J. Ehrnström wrote:
I can not use the foreach statement on the dictionary entries in the table without getting an exception. I've understand that enumerators work the same way.

Actually that is the same thing Smile | :) Underneath it all foreach just uses enumerators to iterate through the collection.

What I would do is to get the collection of keys, then iterate through that; to remove what you need to.

Hashtable table = .....;
object [] keys = new object[table.Keys.Count];
 
table.Keys.CopyTo(keys, 0); // Make a copy of the keys collection
 
foreach(object key in keys)
{
  object obj = table[key];
  // Do something with the table based on obj
}
HTH,

James
"Java is free - and worth every penny." - Christian Graus
GeneralRe: Iterate and modify Pin
J. Ehrnström15-Jul-02 15:02
J. Ehrnström15-Jul-02 15:02 
GeneralRe: Iterate and modify Pin
Eric Gunnerson (msft)16-Jul-02 5:32
Eric Gunnerson (msft)16-Jul-02 5:32 
GeneralRe: Iterate and modify Pin
J. Ehrnström17-Jul-02 1:29
J. Ehrnström17-Jul-02 1:29 
GeneralReflection Pin
Christian Graus15-Jul-02 12:28
protectorChristian Graus15-Jul-02 12:28 
GeneralRe: Reflection Pin
Andy Smith15-Jul-02 13:50
Andy Smith15-Jul-02 13:50 
GeneralRe: Reflection Pin
Christian Graus15-Jul-02 13:55
protectorChristian Graus15-Jul-02 13:55 
GeneralRe: Reflection Pin
Andy Smith15-Jul-02 14:13
Andy Smith15-Jul-02 14:13 
GeneralRe: Reflection Pin
Christian Graus15-Jul-02 14:19
protectorChristian Graus15-Jul-02 14:19 
GeneralRemoting and Load balancing in Multi tier Pin
Orion Buttigieg15-Jul-02 12:21
Orion Buttigieg15-Jul-02 12:21 
GeneralPosition in file Pin
Nnamdi Onyeyiri15-Jul-02 10:28
Nnamdi Onyeyiri15-Jul-02 10:28 
QuestionCode Profiler/Stack Tracer??? Pin
tdb15-Jul-02 7:09
tdb15-Jul-02 7:09 
AnswerRe: Code Profiler/Stack Tracer??? Pin
leppie15-Jul-02 8:01
leppie15-Jul-02 8:01 
GeneralRe: Code Profiler/Stack Tracer??? Pin
tdb15-Jul-02 8:16
tdb15-Jul-02 8:16 
GeneralRemoving CR-LF's from a string using Regex Pin
sultan_of_6string15-Jul-02 6:07
sultan_of_6string15-Jul-02 6:07 
GeneralRe: Removing CR-LF's from a string using Regex Pin
leppie15-Jul-02 6:49
leppie15-Jul-02 6:49 
GeneralRe: Removing CR-LF's from a string using Regex Pin
sultan_of_6string15-Jul-02 7:18
sultan_of_6string15-Jul-02 7:18 
GeneralRe: Removing CR-LF's from a string using Regex Pin
leppie15-Jul-02 7:57
leppie15-Jul-02 7:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.