random string

        public static string GetRandomString(int intSize)
        {
            StringBuilder strBuilder=new StringBuilder();
            Random rndObject=new Random();
            for (int IndCar=0; IndCar<intSize; IndCar++)
            {
                int intRandom=Convert.ToInt32(Math.Floor(26*rndObject.NextDouble()+65));
                char carRandom=Convert.ToChar(intRandom);
                strBuilder.Append(carRandom);
            }
            rndObject=null;
            return strBuilder.ToString().ToLower();
        }
原文地址:https://www.cnblogs.com/jinweijie/p/1077249.html