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);
     }
 }
Ejemplo n.º 2
0
        public void LongSerialKeyTest()
        {
            SerialOperations.Operations opr = new SerialOperations.Operations();
            Boolean CheckLongSerial         = opr.VerifyCode("aiwjdoiajwiodjaoiwjdoiajwdoijaowdjiaoiwjdoiajwdoiajwodijaoiwjdoiajwd");

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

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

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

            Assert.IsTrue(CheckValidSerial);
        }