Exemple #1
0
 public static string statusBarInfo()
 {
     LoadGlobalSettings();
     if (isLicenseValid())
     {
         return("Licencja jest ważna do : " + CryptLib.getDateTo(gs.GetSettingValueOrDefault("LicenseKey", "")));
     }
     else
     {
         return("Licencja jest nieważna.");
     }
 }
Exemple #2
0
        public static bool isLicenseValid()
        {
            LoadGlobalSettings();
            String licenseKey = gs.GetSettingValueOrDefault("LicenseKey", "");
            bool   ret        = false;

            if (CryptLib.isKeyValid(licenseKey))
            {
                DateTime dateTo = Convert.ToDateTime(CryptLib.getDateTo(licenseKey));

                int compare = DateTime.Compare(DateTime.Now, dateTo);

                if (compare <= 0)
                {
                    ret = true;
                }
                //Console.WriteLine(compare);
            }

            return(ret);
        }
Exemple #3
0
 public static string getStartDateOfLicense()
 {
     LoadGlobalSettings();
     return(CryptLib.getDateFrom(gs.GetSettingValueOrDefault("LicenseKey", "")));
 }
Exemple #4
0
 public static int getNumberOfUsers()
 {
     LoadGlobalSettings();
     return(Int32.Parse(CryptLib.getNumOfUsers(gs.GetSettingValueOrDefault("LicenseKey", ""))));
 }