//随机数实例
System.Random rand = new System.Random(unchecked((int)DateTime.Now.Ticks));
for (int i = 0; i < codecount; i++)
{
//获取一个随机数
int t = rand.Next(allchararray.Length);
//合成随机字符串
randomcode += allchararray[t];
}
return randomcode;
}
}
<html xmlns="http://www.w3.org/1999/xhtml" >
<head ;
//随机数实例
System.Random rand = new System.Random(unchecked((int)DateTime.Now.Ticks));
for (int i = 0; i < codecount; i++)
{
//获取一个随机数
int t = rand.Next(allchararray.Length);
//合成随机字符串
randomcode += allchararray[t];
}
return randomcode;
}
}