示例#1
0
        public static string CharsAndNumbers(uint length)
        {
            uint rand = Uint.LessThan(26 + 26 + 10);

            string value;

            if (rand >= 26 + 26)
            {
                value = (rand - 26 - 26).ToString();
            }
            else if (rand >= 26)
            {
                value = ((char)('A' + (rand - 26))).ToString();
            }
            else
            {
                value = ((char)('a' + Uint.LessThan(26))).ToString();
            }

            if (length > 1)
            {
                value += CharsAndNumbers(length - 1);
            }

            return(value);
        }
示例#2
0
        public static string LowerCaseChars(uint length)
        {
            string value = ((char)('a' + Uint.LessThan(26))).ToString();

            if (length > 1)
            {
                value += LowerCaseChars(length - 1);
            }

            return(value);
        }