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 WriteLicence(String Key) { if (File.Exists(LicencePath) == true) { LoggerClass.WriteLogWarning("Licence Deleted"); File.Delete(LicencePath); } File.WriteAllText(LicencePath, CryptographyClass.Encrypt(Key, EncryptionKey)); }