public Boolean ReadLicence()
 {
     try
     {
         String Key = CryptographyClass.Decrypt(File.ReadAllText(LicencePath), EncryptionKey);
         if (Key != "")
         {
             if (opr.VerifyCode(Key) == true)
             {
                 return(true);
             }
             else
             {
                 LoggerClass.WriteLogWarning("Non Valid Licence");
                 File.Delete(LicencePath);
                 return(false);
             }
         }
         else
         {
             LoggerClass.WriteLogWarning("Non Valid Licence");
             File.Delete(LicencePath);
             return(false);
         }
     }
     catch (Exception ex)
     {
         LoggerClass.WriteLogError(ex.Message);
         return(false);
     }
 }
Example #2
0
        public void LongSerialKeyTest()
        {
            SerialOperations.Operations opr = new SerialOperations.Operations();
            Boolean CheckLongSerial         = opr.VerifyCode("aiwjdoiajwiodjaoiwjdoiajwdoijaowdjiaoiwjdoiajwdoiajwodijaoiwjdoiajwd");

            Assert.IsFalse(CheckLongSerial);
        }
Example #3
0
        public void InvalidSerialKeyTest()
        {
            SerialOperations.Operations opr = new SerialOperations.Operations();
            Boolean CheckinvalidSerial      = opr.VerifyCode("PDA03-OF3IA-56M75-05JN8-TOLRR");

            Assert.IsFalse(CheckinvalidSerial);
        }
Example #4
0
        public void NullSerialKeyTest()
        {
            SerialOperations.Operations opr = new SerialOperations.Operations();
            Boolean CheckNullSerial         = opr.VerifyCode("");

            Assert.IsFalse(CheckNullSerial);
        }
Example #5
0
        public void ValidSerialKeyTest()
        {
            SerialOperations.Operations opr = new SerialOperations.Operations();
            Boolean CheckValidSerial        = opr.VerifyCode("PDA03-OF3IA-56M75-05JN8-TOLES");

            Assert.IsTrue(CheckValidSerial);
        }