public static void chk() { DateTime expTime = new DateTime(); string expk = "keTtly7za5UIrDkDlqsU+jqBCzKoBM76no4hzuUnNOo=$5dPNk6aYiLiH+9+dPHfjIQ=="; string l = string.Empty; string sn = string.Empty; try { if (System.Configuration.ConfigurationManager.AppSettings["license"] != null) { l = System.Configuration.ConfigurationManager.AppSettings["license"].ToString(); } if (string.IsNullOrEmpty(l)) { TechnicalException te = new TechnicalException("Your pelsoft license is corrupted. Please contact your suppor or software provider"); te.Source = "Pelsoft Lic mannager"; te.ErrorId = "100"; throw te; } FwkSymetricAlg a = new FwkSymetricAlg(expk); string[] decrypted = a.Dencrypt(l).Split('$'); int index = 0; if (decrypted.Length == 2) { index = 1; sn = decrypted[0]; } string[] d = decrypted[index].Split('|'); expTime = new DateTime(Convert.ToInt32(d[2]), Convert.ToInt32(d[1]), Convert.ToInt32(d[0])); } catch (Exception ex) { TechnicalException te = new TechnicalException("Your pelsoft license has expired or is corrupted. Please contact your suppor or software provider", ex); te.Source = "Pelsoft Lic manager"; te.ErrorId = "100"; throw te; } chkExp(5, expTime); if (!String.IsNullOrEmpty(sn)) { chkAuthorization(sn); } }
public static void chk() { DateTime expTime = new DateTime(); string expk = "7gp6CZ+Y8BZULbjOOkT86vi8HnrtyaIQ6WiLhdY48jY=$PbUiRifcU1q8Egl96hC7tw=="; string l = string.Empty; string sn = string.Empty; try { if (Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "lic") != null) { l = Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "lic").ToString(); } if (string.IsNullOrEmpty(l)) { TechnicalException te = new TechnicalException("Your pelsoft license is corrupted. Please contact your suppor or software provider"); te.Source = "Pelsoft Lic mannager"; te.ErrorId = "100"; throw te; } FwkSymetricAlg a = new FwkSymetricAlg(expk); string[] decrypted = a.Dencrypt(l).Split('$'); string[] d = decrypted[1].Split('|'); sn = decrypted[0]; expTime = new DateTime(Convert.ToInt32(d[2]), Convert.ToInt32(d[1]), Convert.ToInt32(d[0])); } catch (Exception ex) { TechnicalException te = new TechnicalException("Your pelsoft license has expired or is corrupted. Please contact your suppor or software provider", ex); te.Source = "Pelsoft Lic mannager"; te.ErrorId = "100"; throw te; } chkExp(5, expTime); chkAuthorization(sn); }
public static void chk() { DateTime expTime = new DateTime(); string expk = "7gp6CZ+Y8BZULbjOOkT86vi8HnrtyaIQ6WiLhdY48jY=$PbUiRifcU1q8Egl96hC7tw=="; string l = string.Empty; string sn = string.Empty; try { if (Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "lic") != null) l = Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "lic").ToString(); if (string.IsNullOrEmpty(l)) { TechnicalException te = new TechnicalException("Your pelsoft license is corrupted. Please contact your suppor or software provider"); te.Source = "Pelsoft Lic mannager"; te.ErrorId = "100"; throw te; } FwkSymetricAlg a = new FwkSymetricAlg(expk); string[] decrypted = a.Dencrypt(l).Split('$'); string[] d = decrypted[1].Split('|'); sn= decrypted[0]; expTime = new DateTime(Convert.ToInt32(d[2]), Convert.ToInt32(d[1]), Convert.ToInt32(d[0])); } catch (Exception ex) { TechnicalException te = new TechnicalException("Your pelsoft license has expired or is corrupted. Please contact your suppor or software provider", ex); te.Source = "Pelsoft Lic mannager"; te.ErrorId = "100"; throw te; } chkExp(5, expTime); chkAuthorization(sn); }