示例#1
0
        public static string CreateRandomNumericString(int length)
        {
            string result   = "";
            string randChrs = "0123456789";

            for (int i = 0; i < length; i++)
            {
                result += randChrs[ODRandom.Next(0, randChrs.Length - 1)];
            }
            return(result);
        }
示例#2
0
        public static string CreateRandomAlphaNumericString(int length)
        {
            string result   = "";
            string randChrs = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

            for (int i = 0; i < length; i++)
            {
                result += randChrs[ODRandom.Next(0, randChrs.Length - 1)];
            }
            return(result);
        }