using System;

namespace Edu.Common.Encrypt
{
    /// <summary>
    /// 密码帮助类
    /// </summary>
    public static class PwHelper
    {

        /// <summary>
        /// 生成指定长度的随机密码
        /// </summary>
        /// <param name="intlen"></param>
        /// <returns></returns>
        public static string MakePassword(int intlen)
        {
            var stringPwChar = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
            string strRe = "";
            int iRandNum;
            Random rnd = new Random();
            for (int i = 0; i < intlen; i++)
            {
                iRandNum = rnd.Next(stringPwChar.Length);
                strRe += stringPwChar[iRandNum];
            }
            return strRe;
        }
    }
}
