日期:2014-05-17 浏览次数:20919 次
int count = 20; //要生成20个
string s = "0123456789abcdefghjklmnpqrstuvwxyz";
char[] c = new char[5];
int counter = 0;
for (int i = 0; i < s.Length; i++)
{
c[0] = s[i];
for (int j = 0; j < s.Length; j++)
{
c[1] = s[j];
for (int k = 0; k < s.Length; k++)
{
c[2] = s[k];
for (int m = 0; m < s.Length; m++)
{
c[3] = s[m];
for (int n = 0; n < s.Length; n++)
{
if (counter == 0)
n = 1;
c[4] = s[n];
string r = new string(c);
if (counter < count)
{
Response.Write(r + "<br/>");
counter++;
}
else
{
i = j = k = m = n = s.Length;
break;
}
}
}
}
}
}