1 随机生成3个字的名字 【可直接看效果图】
public static List<string> GetTels(int count)
{
List<string> tels = new List<string>() { };
string[] tel1 = new string[] { "130", "187", "156", "179", "188", "199", "180","176","190"};
Random rad = new Random();//实例化随机数产生器rad;
for (int i = 0; i < count;i++ )
{
string tel = tel1[rad.Next(0, tel1.Length - 1)] + StringUtils.FillZero(rad.Next(1000, 10000),4)+StringUtils.FillZero(rad.Next(1000, 10000),4);
if (tels.Contains(tel) == false)
{
tels.Add(tel);
}
else
{
i--;
}
}
return tels;
}
public sta