C# 随机生成验证码

public static string GetCode()
{
string strList ="1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
Random rd = new Random();
string strResult = "";
for (int i = 0; i < 6; i++)
{ strResult
+= strList[rd.Next(0, strList.Length)]; } return strResult; }

 

posted @ 2021-01-10 13:22  筱米米  阅读(576)  评论(0)    收藏  举报