System.Collections.Hashtable.Add C# (CSharp) Method

Add() public method

public Add ( Object key, Object value ) : void
key Object
value Object
return void
        public virtual void Add(Object key, Object value)
        {
            Insert(key, value, true);
        }

Usage Example

Exemplo n.º 1
1
 public ActionResult GetBmCodes(string codes)
 {
     Hashtable ht = new Hashtable();
     string[] str = codes.Split(',');
     foreach (var temp in str)
     {
         switch (temp)
         {
             case "xtzylx":
                 ht.Add(temp, UtilCodeInfo.xtzylx);
                 break;
             case "xtzyzt":
                 ht.Add(temp, UtilCodeInfo.xtzyzt);
                 break;
             case "usRole":
                 ht.Add(temp, UtilCodeInfo.usRole);
                 break;
             case "usstate":
                 ht.Add(temp, UtilCodeInfo.usstate);
                 break;
             case "rolestate":
               //  ht.Add(temp, UtilCodeInfo.rolestate);
                 break;
             case "recode":
                 //ht.Add(temp, UtilCodeInfo.recode);
                 break;
         }
     }
     return Json(ht, JsonRequestBehavior.AllowGet);
 }
All Usage Examples Of System.Collections.Hashtable::Add