• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Collections.Hashtable类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Collections.Hashtable的典型用法代码示例。如果您正苦于以下问题:C# Hashtable类的具体用法?C# Hashtable怎么用?C# Hashtable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Hashtable类属于System.Collections命名空间,在下文中一共展示了Hashtable类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetBmCodes

 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);
 }
开发者ID:pjjwpc,项目名称:.netOA,代码行数:30,代码来源:BmInfoController.cs


示例2: loadParamFile

        public static Hashtable loadParamFile(string Filename)
        {
            Hashtable param = new Hashtable();

            StreamReader sr = new StreamReader(Filename);
            while (!sr.EndOfStream)
            {
                string line = sr.ReadLine();

                if (line.Contains("NOTE:"))
                {
                    CustomMessageBox.Show(line, "Saved Note");
                    continue;
                }

                if (line.StartsWith("#"))
                    continue;

                string[] items = line.Split(new char[] { ' ', ',', '\t' }, StringSplitOptions.RemoveEmptyEntries);

                if (items.Length != 2)
                    continue;

                string name = items[0];
                float value = 0;
                try
                {
                    value = float.Parse(items[1], System.Globalization.CultureInfo.InvariantCulture);// new System.Globalization.CultureInfo("en-US"));
                }
                catch (Exception ex) { log.Error(ex); throw new FormatException("Invalid number on param " + name + " : " + items[1].ToString()); }

                if (name == "SYSID_SW_MREV")
                    continue;
                if (name == "WP_TOTAL")
                    continue;
                if (name == "CMD_TOTAL")
                    continue;
                if (name == "FENCE_TOTAL")
                    continue;
                if (name == "SYS_NUM_RESETS")
                    continue;
                if (name == "ARSPD_OFFSET")
                    continue;
                if (name == "GND_ABS_PRESS")
                    continue;
                if (name == "GND_TEMP")
                    continue;
                if (name == "CMD_INDEX")
                    continue;
                if (name == "LOG_LASTFILE")
                    continue;
                if (name == "FORMAT_VERSION")
                    continue;

                param[name] = value;
            }
            sr.Close();

            return param;
        }
开发者ID:LeoTosti,项目名称:x-drone,代码行数:60,代码来源:ParamFile.cs


示例3: GenerateAuditHistory

        private IResponse GenerateAuditHistory(ICruiseRequest request)
        {
            var velocityContext = new Hashtable();
            var links = new List<IAbsoluteLink>();
            links.Add(new ServerLink(request.UrlBuilder, request.ServerSpecifier, "Server", ActionName));

            ProjectStatusListAndExceptions projects = farmService.GetProjectStatusListAndCaptureExceptions(request.ServerSpecifier, request.RetrieveSessionToken());
            foreach (ProjectStatusOnServer projectStatusOnServer in projects.StatusAndServerList)
            {
                DefaultProjectSpecifier projectSpecifier = new DefaultProjectSpecifier(projectStatusOnServer.ServerSpecifier, projectStatusOnServer.ProjectStatus.Name);
                links.Add(new ProjectLink(request.UrlBuilder, projectSpecifier, projectSpecifier.ProjectName, ServerAuditHistoryServerPlugin.ActionName));
            }
            velocityContext["projectLinks"] = links;
            string sessionToken = request.RetrieveSessionToken(sessionRetriever);
            if (!string.IsNullOrEmpty(request.ProjectName))
            {
                velocityContext["currentProject"] = request.ProjectName;
                AuditFilterBase filter = AuditFilters.ByProject(request.ProjectName);
                velocityContext["auditHistory"] = farmService.ReadAuditRecords(request.ServerSpecifier, sessionToken, 0, 100, filter);
            }
            else
            {
                velocityContext["auditHistory"] = new ServerLink(request.UrlBuilder, request.ServerSpecifier, string.Empty, DiagnosticsActionName);
                velocityContext["auditHistory"] = farmService.ReadAuditRecords(request.ServerSpecifier, sessionToken, 0, 100);
            }

            return viewGenerator.GenerateView(@"AuditHistory.vm", velocityContext);
        }
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:28,代码来源:ServerAuditHistoryServerPlugin.cs


示例4: GetImportedDate

        public static Hashtable GetImportedDate(IList<VDMS.I.Entity.ShippingDetail> shippingList)
        {
            Hashtable data = new Hashtable();
            if ((shippingList == null) || shippingList.Count == 0) return data;

            List<string> listEngines = new List<string>();
            foreach (VDMS.I.Entity.ShippingDetail item in shippingList)
            {
                listEngines.Add(item.EngineNumber);
            }

            //IDao<Iteminstance, long> IISdao = DaoFactory.GetDao<Iteminstance, long>();
            //IISdao.SetCriteria(new ICriterion[] { Expression.In("Enginenumber", listEngines) });
            //IList listIIS = IISdao.GetAll();

            //foreach (Iteminstance item in listIIS)
            //{
            //    data.Add(item.Enginenumber, item.Importeddate);
            //}
            using( var db = new VehicleDataContext() )
            {
                var query = from ii in db.ItemInstances
                            where
                                listEngines.Contains(ii.EngineNumber)
                            select ii;
                foreach (var itemInstance in query)
                {
                    data.Add(itemInstance.EngineNumber, itemInstance.ImportedDate);
                }
                return data;
            }
        }
开发者ID:thaond,项目名称:vdms-sym-project,代码行数:32,代码来源:ItemHepler.cs


示例5: buttonResetSendTime_Click

        private void buttonResetSendTime_Click(object sender, EventArgs e)
        {

       
            Hashtable ht = new Hashtable();
            DateTime dtSelected = dtTradeDate.Value;
            if (comboAssetClass.SelectedIndex < 0)
            {
                MessageBox.Show("Please select asset class","Asset Class", MessageBoxButtons.OK,MessageBoxIcon.Warning);
                return;
            }

            ht["destination"] = txtDestination.Text;
            ht["tradedateid"] = dtSelected.Year * 10000 + dtSelected.Month*100+dtSelected.Day;
            ht["assetclass"] = comboAssetClass.SelectedItem.ToString();

            DataSet ds = (DataSet)BrokerConnection.Request("SetResetTime", ht);

            if (ds != null && ds.Tables.Count > 0)
            {
                ds.Tables[0].TableName = "SetResetTime";
                MessageBox.Show(String.Format("Successfully updated {0} records",ds.Tables[0].Rows[0][0]),"Updated Records",MessageBoxButtons.OK,MessageBoxIcon.Information);
            }
                

           
        }
开发者ID:BrianGoff,项目名称:BITS,代码行数:27,代码来源:ContingencyRecoveryCtl.cs


示例6: CargarPermisos

 /// <summary>
 /// Carga una hashtable que contiene los permisos del usuario (menu desplegable)
 /// </summary>
 /// <returns></returns>
 public Hashtable CargarPermisos()
 {
     MedDAL.DAL.permisos_usuarios permisoUsuario;
     Hashtable htPermisos = new Hashtable();
     int count=1;
     char cPermiso;
     string[] listaPermisos = { "usuarios", "perfiles", 
                                "clientes", "vendedores", "proveedores", "estados", "municipios", "poblaciones", "colonias", 
                                "almacenes", "productos", "inventarios", 
                                "pedidos", "recetas", "remisiones", "facturas", 
                                "causes", "bitacora", 
                                "configuracion", "campos editables", "tipos", "cuentas x cobrar", 
                                "tipos de iva", "ensambles", "lineas de credito"};
        
     foreach (string permiso in listaPermisos) {
         permisoUsuario = (MedDAL.DAL.permisos_usuarios)blPermisosUsuarios.RecuperarPermisos(idUsuario, count);
         cPermiso = (permisoUsuario.TipoAcceso.ToString().ToCharArray())[0];
         if (cPermiso!='N')
             htPermisos.Add(permiso, cPermiso);
         count++;
     }
     permisoUsuario = (MedDAL.DAL.permisos_usuarios)blPermisosUsuarios.RecuperarPermisos(idUsuario, 16);
     cPermiso = (permisoUsuario.TipoAcceso.ToString().ToCharArray())[0];
     if (cPermiso != 'N')
         htPermisos.Add("facturas x receta", cPermiso);
     htPermisos.Add("reportes",'T');
     htPermisos.Add("cambiar contraseña", 'T');
     htPermisos.Add("movimientos", 'T');
     return htPermisos;
 }
开发者ID:jibarradelgado,项目名称:medicuri,代码行数:34,代码来源:BlLogin.cs


示例7: CheckConsistency

		private string CheckConsistency()
		{
			this.PrepareBones();
			Hashtable hashtable = new Hashtable();
			foreach (RagdollBuilder.BoneInfo boneInfo in this.bones)
			{
				if (boneInfo.anchor)
				{
					if (hashtable[boneInfo.anchor] != null)
					{
						RagdollBuilder.BoneInfo boneInfo2 = (RagdollBuilder.BoneInfo)hashtable[boneInfo.anchor];
						string result = string.Format("{0} and {1} may not be assigned to the same bone.", boneInfo.name, boneInfo2.name);
						return result;
					}
					hashtable[boneInfo.anchor] = boneInfo;
				}
			}
			foreach (RagdollBuilder.BoneInfo boneInfo3 in this.bones)
			{
				if (boneInfo3.anchor == null)
				{
					string result = string.Format("{0} has not been assigned yet.\n", boneInfo3.name);
					return result;
				}
			}
			return string.Empty;
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:27,代码来源:RagdollBuilder.cs


示例8: GetItemPriceModel

	    /// <summary>
	    ///     Gets the item price model.
	    /// </summary>
	    /// <param name="item">The item.</param>
	    /// <param name="lowestPrice">The lowest price.</param>
	    /// <param name="tags">Additional tags for promotion evaluation</param>
	    /// <returns>price model</returns>
	    /// <exception cref="System.ArgumentNullException">item</exception>
	    public PriceModel GetItemPriceModel(Item item, Price lowestPrice, Hashtable tags)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            if (lowestPrice == null)
            {
                return new PriceModel();
            }

            var price = lowestPrice.Sale ?? lowestPrice.List;
            var discount = _client.GetItemDiscountPrice(item, lowestPrice, tags);
            var priceModel = CreatePriceModel(price, price - discount, UserHelper.CustomerSession.Currency);
	        priceModel.ItemId = item.ItemId;
            //If has any variations
            /* performance too slow with this method, need to store value on indexing instead
	        if (CatalogHelper.CatalogClient.GetItemRelations(item.ItemId).Any())
	        {
	            priceModel.PriceTitle = "Starting from:".Localize();
	        }
             * */
            return priceModel;
        }
开发者ID:karpinskiy,项目名称:vc-community,代码行数:33,代码来源:MarketingHelper.cs


示例9: FillEventArgs

 private static void FillEventArgs(Hashtable mapArgs, Dictionary<string, string> additionalInfo)
 {
     if (additionalInfo == null)
     {
         for (int i = 0; i < 3; i++)
         {
             string str = (i + 1).ToString("d1", CultureInfo.CurrentCulture);
             mapArgs["AdditionalInfo_Name" + str] = "";
             mapArgs["AdditionalInfo_Value" + str] = "";
         }
     }
     else
     {
         string[] array = new string[additionalInfo.Count];
         string[] strArray2 = new string[additionalInfo.Count];
         additionalInfo.Keys.CopyTo(array, 0);
         additionalInfo.Values.CopyTo(strArray2, 0);
         for (int j = 0; j < 3; j++)
         {
             string str2 = (j + 1).ToString("d1", CultureInfo.CurrentCulture);
             if (j < array.Length)
             {
                 mapArgs["AdditionalInfo_Name" + str2] = array[j];
                 mapArgs["AdditionalInfo_Value" + str2] = strArray2[j];
             }
             else
             {
                 mapArgs["AdditionalInfo_Name" + str2] = "";
                 mapArgs["AdditionalInfo_Value" + str2] = "";
             }
         }
     }
 }
开发者ID:nickchal,项目名称:pash,代码行数:33,代码来源:EventLogLogProvider.cs


示例10: Put

        /// <summary>
        /// Puts new values into xively feed.
        /// </summary>
        /// <param name="ids">The ids.</param>
        /// <param name="values">The values.</param>
        /// <exception cref="System.ApplicationException">The xively server returned invalid status code.</exception>
        public void Put(string[] ids, object[] values)
        {
            var datastreams = new Hashtable[ids.Length];
            for (int i = 0; i < ids.Length; i++)
                datastreams[i] = new Hashtable
                                    {
                                        {"id",ids[i]},
                                        {"current_value",values[i]},
                                    };

            var json = new Hashtable
            {
                {"version","1.0.0"},
                {"datastreams",datastreams},
            };


            var request = new HttpRequest
            {
                Method = "PUT",
                Url = url,
                Content = JSON.JsonEncode(json),
            };

            request.AddHeader("X-ApiKey", apiKey);

            var response = httpClient.ExecuteRequest(request);

            if (response.StatusCode != 200)
                throw new ApplicationException("Xively server returned invalid status code : " + response.StatusCode);
        }
开发者ID:NicolasFatoux,项目名称:NfxLab.MicroFramework,代码行数:37,代码来源:XivelyClient.cs


示例11: Execute

        public IResponse Execute(ICruiseRequest request)
        {
            Hashtable velocityContext = new Hashtable();
            ArrayList links = new ArrayList();
            links.Add(new ServerLink(urlBuilder, request.ServerSpecifier, "Server Log", ActionName));

            ProjectStatusListAndExceptions projects = farmService.GetProjectStatusListAndCaptureExceptions(request.ServerSpecifier,
                request.RetrieveSessionToken());
            foreach (ProjectStatusOnServer projectStatusOnServer in projects.StatusAndServerList)
            {
                DefaultProjectSpecifier projectSpecifier = new DefaultProjectSpecifier(projectStatusOnServer.ServerSpecifier, projectStatusOnServer.ProjectStatus.Name);
                links.Add(new ProjectLink(urlBuilder, projectSpecifier, projectSpecifier.ProjectName, ServerLogProjectPlugin.ActionName));
            }
            velocityContext["projectLinks"] = links;
            if (string.IsNullOrEmpty(request.ProjectName))
            {
                velocityContext["log"] = HttpUtility.HtmlEncode(farmService.GetServerLog(request.ServerSpecifier, request.RetrieveSessionToken()));
            }
            else
            {
                velocityContext["currentProject"] = request.ProjectSpecifier.ProjectName;
                velocityContext["log"] = HttpUtility.HtmlEncode(farmService.GetServerLog(request.ProjectSpecifier, request.RetrieveSessionToken()));
            }

            return viewGenerator.GenerateView(@"ServerLog.vm", velocityContext);
        }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:26,代码来源:ServerLogServerPlugin.cs


示例12: Execute

		public HtmlFragmentResponse Execute()
		{
			Hashtable velocityContext = new Hashtable();

			string serverName = request.ServerName;
			string categoryName = GetCategory();
            string projectName = request.ProjectName;
			string buildName = request.BuildName;

			velocityContext["serverName"] = serverName;
			velocityContext["categoryName"] = categoryName;
			velocityContext["projectName"] = projectName;
			velocityContext["buildName"] = buildName;

			velocityContext["farmLink"] = linkFactory.CreateFarmLink("Dashboard", FarmReportFarmPlugin.ACTION_NAME);

			if (serverName != string.Empty)
			{
				velocityContext["serverLink"] = linkFactory.CreateServerLink(request.ServerSpecifier, ServerReportServerPlugin.ACTION_NAME);
			}

            if (categoryName != string.Empty)
            {
                IServerSpecifier serverSpecifier;
                try
                {
                    serverSpecifier = request.ServerSpecifier;
                }
                catch (ThoughtWorks.CruiseControl.Core.CruiseControlException)
                {
                    serverSpecifier = null;
                }

                if (serverSpecifier != null)
                {
                    velocityContext["categoryLink"] = new GeneralAbsoluteLink(categoryName, linkFactory
                        .CreateServerLink(serverSpecifier, "ViewServerReport")
                        .Url + "?Category=" + HttpUtility.UrlEncode(categoryName));
                }
                else
                {
                    velocityContext["categoryLink"] = new GeneralAbsoluteLink(categoryName, linkFactory
                        .CreateFarmLink( "Dashboard", FarmReportFarmPlugin.ACTION_NAME )
                        .Url + "?Category=" + HttpUtility.UrlEncode(categoryName));
                }
            }


			if (projectName != string.Empty)
			{
				velocityContext["projectLink"] = linkFactory.CreateProjectLink(request.ProjectSpecifier,  ProjectReportProjectPlugin.ACTION_NAME);
			}

			if (buildName != string.Empty)
			{
				velocityContext["buildLink"] = linkFactory.CreateBuildLink(request.BuildSpecifier,  BuildReportBuildPlugin.ACTION_NAME);
			}

			return velocityViewGenerator.GenerateView("TopMenu.vm", velocityContext);
		}
开发者ID:robrich,项目名称:CruiseControl.NET,代码行数:60,代码来源:TopControlsViewBuilder.cs


示例13: Save_Click

 protected void Save_Click(object sender, EventArgs e)
 {
     string s = this.Session["dt_session_code"].ToString().ToLower();
     if (this.txtCode.Value.ToLower() != this.Session["dt_session_code"].ToString().ToLower())
     {
         this.txtCode.Focus();
         this.errorMsg.InnerHtml = "验证码输入不正确!";
     }
     else
     {
         int i = 0;
         if (this.txtUserName.Value != "Administrator")
         {
             Hashtable ht_User = new Hashtable();
             ht_User["User_Pwd"] = Md5Helper.MD5(this.txtUserPwd.Value, 32);
             i = system_idao.UpdateByHashtable("Base_UserInfo", "User_ID", RequestSession.GetSessionUser().UserId.ToString(), ht_User);
         }
         if (i > 0)
         {
             this.Session.Abandon();
             this.Session.Clear();
             base.Response.Write("<script>alert('登陆修改成功,请重新登陆');top.location.href='../../Index.htm'</script>");
         }
         else
         {
             this.errorMsg.InnerHtml = "修改登录密码失败";
         }
     }
 }
开发者ID:txy-cs,项目名称:NewSaas,代码行数:29,代码来源:UpdateUserPwd.aspx.cs


示例14: CreateInOutParamTypes

		protected override Type[] CreateInOutParamTypes(Uiml.Param[] parameters, out Hashtable outputPlaceholder)
		{
			outputPlaceholder = null;
			Type[] tparamTypes =  new Type[parameters.Length]; 
			int i=0;
			try
			{
				for(i=0; i<parameters.Length; i++)
				{
					tparamTypes[i] = Type.GetType(parameters[i].Type);
					int j = 0;
					while(tparamTypes[i] == null)	
						tparamTypes[i] = ((Assembly)ExternalLibraries.Instance.Assemblies[j++]).GetType(parameters[i].Type);
					//also prepare a placeholder when this is an output parameter
					if(parameters[i].IsOut)
					{
						if(outputPlaceholder == null)
							outputPlaceholder = new Hashtable();
						outputPlaceholder.Add(parameters[i].Identifier, null);
					}
				}
				return tparamTypes;
			}
				catch(ArgumentOutOfRangeException aore)
				{
					Console.WriteLine("Can not resolve type {0} of parameter {1} while calling method {2}",parameters[i].Type ,i , Call.Name);
					Console.WriteLine("Trying to continue without executing {0}...", Call.Name);
					throw aore;					
				}
		}
开发者ID:jozilla,项目名称:Uiml.net,代码行数:30,代码来源:LocalCaller.cs


示例15: ESData

 /// <summary>
 /// 構造
 /// </summary>
 protected ESData()
 {
     dict = new Hashtable();
     dict.Add("itemno", "物品編號");
     dict.Add("item", "產品");
     dict.Add("model", "型號");
 }
开发者ID:eddylin2015,项目名称:ES_TABLE,代码行数:10,代码来源:ES_DataLayer.cs


示例16: CollaboratingWorkbooksEnvironment

 private CollaboratingWorkbooksEnvironment(String[] workbookNames, WorkbookEvaluator[] evaluators, int nItems)
 {
     Hashtable m = new Hashtable(nItems * 3 / 2);
     Hashtable uniqueEvals = new Hashtable(nItems * 3 / 2);
     for (int i = 0; i < nItems; i++)
     {
         String wbName = workbookNames[i];
         WorkbookEvaluator wbEval = evaluators[i];
         if (m.ContainsKey(wbName))
         {
             throw new ArgumentException("Duplicate workbook name '" + wbName + "'");
         }
         if (uniqueEvals.ContainsKey(wbEval))
         {
             String msg = "Attempted To register same workbook under names '"
                 + uniqueEvals[(wbEval) + "' and '" + wbName + "'"];
             throw new ArgumentException(msg);
         }
         uniqueEvals[wbEval]=wbName;
         m[wbName] = wbEval;
     }
     UnhookOldEnvironments(evaluators);
     //HookNewEnvironment(evaluators, this); - moved to Setup method above
     _unhooked = false;
     _evaluators = evaluators;
     _evaluatorsByName = m;
 }
开发者ID:missxiaohuang,项目名称:Weekly,代码行数:27,代码来源:CollaboratingWorkbooksEnvironment.cs


示例17: doCreate

        /// <summary>
        /// 新增基本檔資料(使用交易)
        /// </summary>
        /// <param name="htParams">放入輸入的參數</param>
        /// <param name="DBT">交易變數</param>
        /// <returns>回傳影響筆數</returns>
        public void doCreate(Hashtable htParams,
                            DbTransaction DBT
                            )
        {
            try
            {
                DbCommand cmd = db.GetStoredProcCommand("PKG_VDS_ALO_PATTERNSPEC_DETL.ADD_PATTERNSPEC_DETL");
                db.AddInParameter(cmd, "ID", DbType.VarNumeric, htParams["ID"]);
                db.AddInParameter(cmd, "PID", DbType.VarNumeric, htParams["PID"]);
                db.AddInParameter(cmd, "vCreateDate", DbType.Date, htParams["CREATEDATE"]);
                db.AddInParameter(cmd, "vCreateUID", DbType.String, htParams["CREATEUID"]);
                db.AddInParameter(cmd, "vUpdateDate", DbType.Date, htParams["UPDATEDATE"]);
                db.AddInParameter(cmd, "vUpdateUID", DbType.String, htParams["UPDATEUID"]);
                db.AddInParameter(cmd, "nSTART_RANKQTY", DbType.VarNumeric, htParams["START_RANKQTY"]);
                db.AddInParameter(cmd, "nEND_RANKQTY", DbType.VarNumeric, htParams["END_RANKQTY"]);
                db.AddInParameter(cmd, "nADJ_QTY", DbType.VarNumeric, htParams["ADJ_QTY"]);

                int ProcessRecord = (DBT == null) ? db.ExecuteNonQuery(cmd) : db.ExecuteNonQuery(cmd, DBT);

                if (ProcessRecord == 0)
                {
                    throw new Exception("輸入資料失敗!");
                }
            }
            catch (Exception ex)
            {
                throw new Exception("呼叫VDS_ALO_PATTERNSPEC_DETL_DBO.doCreate()發生錯誤,錯誤訊息:"
                                    + OracleExceptionProcess.OracleExceptionStringCut(ex.Message));
            }
        }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:36,代码来源:VDS_ALO_PATTERNSPEC_DETL_DBO.cs


示例18: GetDiskInfo

 public JsonObject GetDiskInfo()
 {
   try
   {
     var diskinfo = new JsonObject();
     var volumes = new ArrayList();
     foreach (var vi in VolumeInfo.GetVolumes())
     {
       var v = new Hashtable();
       v.Add("root", vi.RootDirectory);
       v.Add("size", vi.TotalSize);
       v.Add("free", vi.TotalFreeSpace);
       v.Add("formatted", vi.IsFormatted);
       v.Add("volumeid", vi.VolumeID);
       v.Add("content", GetRootFolderInfo(vi.RootDirectory));
       volumes.Add(v);
     }
     diskinfo.Add("volumes", volumes);
     return diskinfo;
   }
   catch (Exception ex)
   {
     var error = new JsonObject();
     error.Add("error", ex.ToString());
     error.Add("stacktrace", ex.StackTrace);
     return error;
   }
 }
开发者ID:ricflams,项目名称:Goke.ChickenHouse,代码行数:28,代码来源:HardwareInfo.cs


示例19: HttpChannel

        } // HttpChannel

        public HttpChannel(IDictionary properties, 
                           IClientChannelSinkProvider clientSinkProvider,
                           IServerChannelSinkProvider serverSinkProvider)
        {
            Hashtable clientData = new Hashtable();
            Hashtable serverData = new Hashtable();
        
            // divide properties up for respective channels
            if (properties != null)
            {            
                foreach (DictionaryEntry entry in properties)
                {
                    switch ((String)entry.Key)
                    {
                    // general channel properties
                    case "name": _channelName = (String)entry.Value; break;
                    case "priority": _channelPriority = Convert.ToInt32((String)entry.Value, CultureInfo.InvariantCulture); break;
                    case "secure": _secure = Convert.ToBoolean(entry.Value, CultureInfo.InvariantCulture); 
                                    clientData["secure"] = entry.Value;
                                    serverData["secure"] = entry.Value;
                                    break;
                    default: 
                        clientData[entry.Key] = entry.Value;
                        serverData[entry.Key] = entry.Value;
                        break;
                    }
                }
            }

            _clientChannel = new HttpClientChannel(clientData, clientSinkProvider);
            _serverChannel = new HttpServerChannel(serverData, serverSinkProvider);
        } // HttpChannel
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:34,代码来源:combinedhttpchannel.cs


示例20: Constructor_SendInDictionaryWithNonStringKey_ThrowsArgumentException

		public void Constructor_SendInDictionaryWithNonStringKey_ThrowsArgumentException() {
			var attributeValueCollection = A.Fake<IAttributeValueCollection>();
			var dictionary = new Hashtable();
			dictionary.Add(new object(), attributeValueCollection);

			Assert.Throws<ArgumentException>(() => new AttributeCollection(dictionary));
		}
开发者ID:aelveborn,项目名称:njupiter,代码行数:7,代码来源:AttributeCollectionTests.cs



注:本文中的System.Collections.Hashtable类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Collections.ObservableCollection类代码示例发布时间:2022-05-26
下一篇:
C# Collections.DictionaryEntry类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap