foreach (DictionaryEntry item in second)
{
first[item.Key] = item.Value;
}
Si es necesario, se podría rodar esto en un método de extensión (si se asume que está utilizando .NET 3.5 o más reciente).
Hashtable one = GetHashtableFromSomewhere();
Hashtable two = GetAnotherHashtableFromSomewhere();
one.UpdateWith(two);
// ...
public static class HashtableExtensions
{
public static void UpdateWith(this Hashtable first, Hashtable second)
{
foreach (DictionaryEntry item in second)
{
first[item.Key] = item.Value;
}
}
}
¿Tiene algún código para mostrarnos, para ver cómo podemos ayudarlo? En otras palabras, ¿qué has intentado? –
¿Está buscando fusionar dos tablas hash? –
sí exactamente lo último con hashtable viejo. – shahjapan