当前位置: 首页>>代码示例>>C#>>正文


C# ArrayList.ToString方法代码示例

本文整理汇总了C#中ArrayList.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ArrayList.ToString方法的具体用法?C# ArrayList.ToString怎么用?C# ArrayList.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ArrayList的用法示例。


在下文中一共展示了ArrayList.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: checksubfolders

    public void checksubfolders(ref ArrayList alcheck, string dir,string key)
    {
        string[] folders = Directory.GetDirectories(dir);
        foreach (string folder in folders)
        {
            string appdir = dir;
            //string foldername = folder.Substring(appdir.Length);
            string foldername = folder;
            if (!foldername.Contains("_svn") && (!foldername.Contains(".svn")))
            {
                alcheck.Add(foldername);
            }

        }
        string key2 = key;
        string[] dirs = Directory.GetDirectories(dir);
        foreach (string dir2 in dirs)
        {
            checksubfolders(ref alcheck, dir2,key2);
        }
        for (int x = 0; x <= alcheck.Count; x++)
        {
            if (!alcheck.ToString().Contains("medium"))
            {
                try
                {
                    Directory.CreateDirectory(Server.MapPath("~/App_Uploads_Img/" + key) + "\\medium");
                }
                catch (Exception e)
                {
                    //errorlabelauto.Text = e.Message;
                }
            }
            if (!alcheck.ToString().Contains("small"))
            {
                try
                {
                    Directory.CreateDirectory(Server.MapPath("~/App_Uploads_Img/" + key) + "\\small");
                }
                catch (Exception e)
                {
                    //errorlabelauto.Text = e.Message;
                }
            }
            //if (!alcheck.ToString().Contains("large"))
            //{
            //    try
            //    {
            //        Directory.CreateDirectory(Server.MapPath("~/App_Uploads_Img/" + key) + "\\large");
            //    }
            //    catch (Exception e)
            //    {
            //        errorlabelauto.Text = e.Message;
            //    }
            //}
        }
    }
开发者ID:wpdildine,项目名称:wwwroot,代码行数:57,代码来源:Autoresize.cs

示例2: Temporary

    private void Temporary()
    {
        int CValLength, RequestLength;
        if (ViewState["CurrentValue"].ToString() == "")
        {
            CValLength = 0;
        }
        else
        {
            CValLength = ViewState["CurrentValue"].ToString().Split(',').Length;
        }
        if (CheckForm("user_id") == "")
        {
            RequestLength = 0;
        }
        else
        {
            RequestLength = Request.Form["user_id"].Split(',').Length;
        }
        ArrayList tmpArray = new ArrayList();
        if (Session["Usertemporary"].ToString() != "")
        {
            string[] ChangeAry = Session["Usertemporary"].ToString().Split(',');
            for (int j = 0; j < ChangeAry.Length; j++)
            {
                tmpArray.Add(ChangeAry[j]);
            }
        }

        string strUserID1 = "";

        //移除這一頁舊有的資料
        if (CValLength > 0)
        {

            string[] aBeforeUserID = ViewState["CurrentValue"].ToString().Split(',');

            foreach (string strUserID in aBeforeUserID)
            {
                if (tmpArray.Count > 0)  //Session("Usertemporary")記錄未上傳前,所挑選的使用者
                {
                    foreach (string strTemp in tmpArray)
                    {
                        strUserID1 = strTemp.Split('_')[0];
                        if (strUserID1 == strUserID)
                        {
                            tmpArray.Remove(strTemp);
                            break;
                        }
                    }
                }
            }
        }

        //新增這一頁的現有資料
        string[] pick_user;
        if (CheckForm("user_id") != "")
        {
            pick_user = Request.Form["user_id"].Split(',');
            if (RequestLength > 0)
            {
                for (int i = 0; i < pick_user.Length; i++)
                {
                    tmpArray.Add(pick_user[i]);
                }
            }

        }

        //將ArrayList轉成字串
        string strTemporary = "";
        if (tmpArray.ToString() != "" && tmpArray != null)
        {
            for (int k = 0; k < tmpArray.Count; k++)
            {
                strTemporary += tmpArray[k] + ",";
            }
            if (strTemporary != "") strTemporary = strTemporary.Substring(0, strTemporary.Length - 1);
        }

        Session["Usertemporary"] = strTemporary;
    }
开发者ID:quangtrung00,项目名称:QCLogBlook,代码行数:82,代码来源:PickUserToFact104.aspx.cs

示例3: isInArrayList

    public bool isInArrayList(string str, ArrayList _list)
    {
        bool _in = false;
        for (int i = 0; i < _list.Count; i++)
        {
            if (string.Compare(_list.ToString(), str) == 0)
            {
                _in = true;
                break;
            }
        }

        return _in;
    }
开发者ID:wra222,项目名称:testgit,代码行数:14,代码来源:OfflineLabelPrint.aspx.cs

示例4: ReadTerms

 public void ReadTerms(MemoryStore rdfStore)
 {
     Resource[] terms = rdfStore.SelectObjects(mUri, P_HAS_TERM);
     Set<string> skipList = new Set<string>();
     foreach (Literal term in terms)
     {
         mTokenizer.Text = Normalize(mIgnoreCase ? term.Value.ToLower() : term.Value);
         ArrayList<string> tokens = new ArrayList<string>();
         foreach (string token in mTokenizer)
         {
             string tokenLower = token.ToLower();
             if (!IsStopWord(tokenLower)) { tokens.Add(token); }
         }
         if (tokens.Count > 0 && !skipList.Contains(tokens.ToString()))
         {
             Term termObj = new Term();
             termObj.mWords = tokens;
             mTerms.Add(termObj);
             skipList.Add(tokens.ToString());
         }
     }
 }
开发者ID:viidea,项目名称:latino,代码行数:22,代码来源:SemanticAnnotator.cs

示例5: beta

  /*! 
    \brief Execute a promoter reaction as describe in the detailled reaction
    \details Once the tree is executed, the result is put in delta and used as follow :
    
    For each Product P in the operon :
    
                [P] += delta * RBSf * TerminatorFactor * beta(Maximal production)
    
    \param molecules The list of molecules
  */
  public override void react(ArrayList molecules)
  {
    if (!_isActive) {
	  if(_debug) Logger.Log("PromoterReaction::react !_isActive", Logger.Level.TRACE);
      return;
	}
    float delta = execNode(_formula, molecules);

    float energyCoef;
    float energyCostTot;    
    if (delta > 0f && _energyCost > 0f && enableEnergy)
      {
        energyCostTot = _energyCost * delta;
        energyCoef = _medium.getEnergy() / energyCostTot;
        if (energyCoef > 1f)
          energyCoef = 1f;
        _medium.subEnergy(energyCostTot);
      }
    else
      energyCoef = 1f;

    delta *= energyCoef;
	
    foreach (Product pro in _products)
      {
	    if(_debug) Logger.Log("PromoterReaction::react product="+pro, Logger.Level.TRACE);
        Molecule mol = ReactionEngine.getMoleculeFromName(pro.getName(), molecules);
			
        if( mol == null) Debug.Log("mol is null, pro.getName()="+pro.getName()+", molecules="+molecules.ToString());
        if( pro == null) Debug.Log("pro is null");
			
		float increase = delta * pro.getQuantityFactor() * _terminatorFactor * _beta
                           * ReactionEngine.reactionsSpeed * _reactionSpeed;
		
		if(Logger.isLevel(Logger.Level.TRACE)) {
		  if(_debug) Logger.Log("PromoterReaction::react increase="+increase
					+", delta:"+delta
					+", qFactor:"+pro.getQuantityFactor()
					+", tFactor:"+_terminatorFactor
					+", beta:"+_beta
                    +", reactionsSpeed:"+ReactionEngine.reactionsSpeed
					+", reactionSpeed:"+_reactionSpeed
					, Logger.Level.TRACE
					);
		}
			
        if (enableSequential) {
		  float oldCC = mol.getConcentration();
		  mol.addConcentration(increase);
		  float newCC = mol.getConcentration();
		  if(_debug) Logger.Log("PromoterReaction::react ["+mol.getName()+"]old="+oldCC
					+" ["+mol.getName()+"]new="+newCC
					, Logger.Level.TRACE
					);
        } else {
		  mol.addNewConcentration(increase);
		  if(_debug) Logger.Log("PromoterReaction::react ["+mol.getName()+"]="+mol.getConcentration()+" addNewConcentration("+increase+")"
					, Logger.Level.TRACE
					);
	    }
				
      }
  }
开发者ID:CyberCRI,项目名称:Hero.Coli,代码行数:73,代码来源:PromoterReaction.cs


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