求助,想要得到一千个6位验证码,大家帮帮忙
一千个六位的验证码,验证码由0-9和A-Z的字数与数字的随机组合
我没学过编程,请大家帮帮忙
我刚装了一个VS2010 希望大家帮帮
[解决办法]
int[] x = new int[6];
for (int i = 0; i < 6; i++)
{
Random ran = new Random();
x[i] = ran.Next(35);
}
string[] a = new string[6];
for (int i = 0; i < 6; i++)
{
a[i] = Convert.ToString(x[i]);
switch (x[i])
{
case 10: a[i] = "A"; break;
case 11: a[i] = "B"; break;
case 12: a[i] = "C"; break;
case 13: a[i] = "D"; break;
case 14: a[i] = "E"; break;
case 15: a[i] = "F"; break;
case 16: a[i] = "G"; break;
case 17: a[i] = "H"; break;
case 18: a[i] = "I"; break;
case 19: a[i] = "J"; break;
case 20: a[i] = "K"; break;
case 21: a[i] = "L"; break;
case 22: a[i] = "M"; break;
case 23: a[i] = "N"; break;
case 24: a[i] = "O"; break;
case 25: a[i] = "P"; break;
case 26: a[i] = "Q"; break;
case 27: a[i] = "R"; break;
case 28: a[i] = "S"; break;
case 29: a[i] = "T"; break;
case 30: a[i] = "U"; break;
case 31: a[i] = "V"; break;
case 32: a[i] = "W"; break;
case 33: a[i] = "X"; break;
case 34: a[i] = "Y"; break;
case 35: a[i] = "Z"; break;
default: Console.WriteLine("出错!"); break;
}
}
string num = null;
for (int i = 0; i < 6; i++)
{
num = string.Concat(num, a[i]);
}