字母与数字 随机组合 N位数 要打印全部组合 
这个循环怎么写? 
类似生成字典这种 我要做的是 生成N位(N是随机的)的所有组合的字典!

解决方案 »

  1.   

    public static string f2(int strLen)
    {
    char[] destChar= {'A','B','C','D','E','F','G','H','I','G','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9'};
    Random rd = new Random();
    StringBuilder strBld = new StringBuilder();
    for(int i = 0; i < strLen; i++)
    {
    strBld.Append( destChar[rd.Next(0, 36)] );
    } return strBld.ToString();
    }