public static string GetRandomString(int iLength)
{
string buffer = "";// 随机字符中也可以为汉字(任何)
StringBuilder sb = new StringBuilder();
Random r = new Random();
int range = buffer.Length;
for (int i = ; i < iLength; i++)
{
sb.Append(buffer.Substring(r.Next(range),));
}
return sb.ToString();
}
借鉴原文:https://blog.csdn.net/sds15732622190/article/details/51426527