Esempio n. 1
0
        public static string GetRandomAltString(int length, int seed)
        {
            var s    = "";
            var rand = new System.Random(seed);

            for (var i = 0; i < length; i++)
            {
                if (JMaths.IsOdd(i))
                {
                    s += ALLNUMERIC[rand.Next(ALLNUMERIC.Length)];
                }
                else
                {
                    s += ALLALPHA[rand.Next(ALLALPHA.Length)];
                }
            }
            return(s);
        }
Esempio n. 2
0
        public static string GetRandomAltString(int length)
        {
            var s    = "";
            var rand = new System.Random(System.DateTime.UtcNow.Millisecond);

            for (int i = 0; i < length; i++)
            {
                if (JMaths.IsOdd(i))
                {
                    s += ALLNUMERIC[rand.Next(ALLNUMERIC.Length)];
                }
                else
                {
                    s += ALLALPHA[rand.Next(ALLALPHA.Length)];
                }
            }
            return(s);
        }