Example #1
0
        public static string RndString(int n)
        {
            string   str    = "";
            int      num    = 0;
            HardTime time   = new HardTime();
            Random   random = new Random(time.GetAbsoluteIntTime());

            for (int i = 0; i < n; i++)
            {
                num = random.Next(0x3e);
                if ((num >= 0) && (num < 10))
                {
                    str = str + num.ToString().Trim();
                }
                else if (num < 0x24)
                {
                    str = str + Convert.ToChar((int)(num + 0x37));
                }
                else if (num < 0x3e)
                {
                    str = str + Convert.ToChar((int)(num + 0x3d));
                }
                else
                {
                    i--;
                }
            }
            return(str);
        }
Example #2
0
        public static string RndNum(int n)
        {
            string   str    = "";
            int      num    = 0;
            HardTime time   = new HardTime();
            Random   random = new Random(time.GetAbsoluteIntTime());

            for (int i = 0; i < n; i++)
            {
                num = random.Next(10);
                str = str + num.ToString().Trim();
            }
            return(str);
        }