标签:append bsp ring next 随机数 random stat i++ ram
/// <summary>
/// 生成0-9随机数
/// </summary>
/// <param name="codeNum">生成长度</param>
/// <returns></returns>
public static string RndNum(int codeNum)
{
StringBuilder sb = new StringBuilder(codeNum);
Random rand = new Random();
for (int i = 1; i < codeNum + 1; i++)
{
int t = rand.Next(9);
sb.AppendFormat("{0}", t);
}
return sb.ToString();
}
标签:append bsp ring next 随机数 random stat i++ ram
原文地址:https://www.cnblogs.com/zbliao/p/13253896.html