本文整理汇总了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;
// }
//}
}
}
示例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;
}
示例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;
}
示例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());
}
}
}
示例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
);
}
}
}