Example #1
0
        public string GenerateHDTAuthorizationCode(string MCode, int clientMaxCount)
        {
            string             DTDAuthorizeCode = null;
            HDTAuthorizeHelper helper           = new HDTAuthorizeHelper();

            try
            {
                //硬件码(注册码)
                var time_    = helper.GetTailFlagToInt(MCode);                    //软件注册次数
                var timeCode = EncryptUtil.Base64Encrypt((time_ + 1).ToString()); //加密后的次数
                var connNum_ = clientMaxCount;

                var    connNumCode = EncryptUtil.Base64Encrypt(connNum_.ToString()); //加密后的连接数
                string strLicence  = helper.GetRNum(MCode) + timeCode + connNumCode; //注册码 = 根据机器生产的注册码 + 注册次数码 + 最大连接数码
                DTDAuthorizeCode = strLicence;
            }
            catch (System.Exception)
            {
                //"输入的机器码格式错误!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            return(DTDAuthorizeCode);
        }