Esempio n. 1
0
        public void EncryptoOrDecrypt()
        {
            const string text      = "234#$23sdfsdfs$%$d4234234";
            var          encryptor = Cores.Encrypto(text);

            encryptor = Cores.Decrypto(encryptor);
            Assert.Equal(text, encryptor);
        }
Esempio n. 2
0
        /// <summary>
        /// 保存注册码。
        /// </summary>
        /// <param name="registration">注册码实例。</param>
        /// <returns>返回保存结果。</returns>
        public async Task <bool> SaveRegistrationAsync(Registration registration)
        {
            var lisence = new Lisence {
                Registration = Cores.Encrypto(registration.ToJsonString())
            };

            if (await _context.AnyAsync())
            {
                return(await _context.UpdateAsync(lisence));
            }
            return(await _context.CreateAsync(lisence));
        }