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); } }
public void LongSerialKeyTest() { SerialOperations.Operations opr = new SerialOperations.Operations(); Boolean CheckLongSerial = opr.VerifyCode("aiwjdoiajwiodjaoiwjdoiajwdoijaowdjiaoiwjdoiajwdoiajwodijaoiwjdoiajwd"); Assert.IsFalse(CheckLongSerial); }
public void InvalidSerialKeyTest() { SerialOperations.Operations opr = new SerialOperations.Operations(); Boolean CheckinvalidSerial = opr.VerifyCode("PDA03-OF3IA-56M75-05JN8-TOLRR"); Assert.IsFalse(CheckinvalidSerial); }
public void NullSerialKeyTest() { SerialOperations.Operations opr = new SerialOperations.Operations(); Boolean CheckNullSerial = opr.VerifyCode(""); Assert.IsFalse(CheckNullSerial); }
public void ValidSerialKeyTest() { SerialOperations.Operations opr = new SerialOperations.Operations(); Boolean CheckValidSerial = opr.VerifyCode("PDA03-OF3IA-56M75-05JN8-TOLES"); Assert.IsTrue(CheckValidSerial); }