V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  bernard  ›  全部回复第 1 页 / 共 1 页
回复总数  1
2015-08-05 13:27:19 +08:00
回复了 xiaobetty 创建的主题 推广 晒出你最蠢的一段代码,送 Cherry 鼠标垫
Hashtable tempht=new Hashtable();
if(tempht.Contains(tempname))
{
string countnum=tempht[tempname].ToString();
string tempvalue="";
if(tempname.Trim().Length==countnum.Trim().Length)
{
tempvalue=tempname+"1";
}
else
{
countnum=countnum.Substring(tempname.Trim().Length,countnum.Trim().Length-tempname.Trim().Length);
int currentnum=int.Parse(countnum)+1;
tempvalue=tempname+currentnum.ToString();
}
tempht.Remove(tempname);
tempht.Add(tempname,tempvalue);
}
else
{
tempht.Add(tempname,tempname);
}
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1364 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 17:47 · PVG 01:47 · LAX 10:47 · JFK 13:47
Developed with CodeLauncher
♥ Do have faith in what you're doing.