예제 #1
0
        /// <summary>
        /// 根据机器的IP与Mac地址信息生成机器码
        /// 根据不同的授权类型传入不同的值即可。
        /// </summary>
        /// <param name="ipStr">Ip的字符串</param>
        /// <param name="macStr">Mac地址的字符串</param>
        /// <param name="lisenceType">授权类型</param>
        /// <returns></returns>
        public string CreateMCode(string ipStr, string macStr, LicenseTypeEnum lisenceType)
        {
            //根据不同的授权类型,进行不同的判定
            switch (lisenceType)
            {
            case LicenseTypeEnum.Ip:
                macStr = "notwhitmac";
                break;

            case LicenseTypeEnum.Mac:
                ipStr = "notwhitip";
                break;

            default:
                ipStr  = ipStr ?? "notwhitip";;
                macStr = macStr ?? "notwhitmac";
                break;
            }

            string mCode = "";

            mCode = DESEncrypt.Encrypt(macStr, ipStr);
            mCode = MD5Encrypt.GetMD5_16(mCode);
            mCode = Base64Encrypt.Encrypt(mCode);
            return(mCode);
        }
예제 #2
0
 /// <summary>
 /// 获取用户密码加密的密钥
 /// </summary>
 /// <returns></returns>
 public string GetSecretkey()
 {
     return(MD5Encrypt.GetMD5_16(Utility.CreateNo()));
 }