Example #1
0
        private void LoadLicenseStatus()
        {
            GlobalSettings gs = new GlobalSettings();

            gs.LoadSettings();
            tbLicenseKey.Text = gs.GetSettingValueOrDefault("LicenseKey", "");

            if (tbLicenseKey.Text.Trim() == "")
            {
                lblLicenseInfo.Text = "";
                return;
            }

            if (CryptLib.isKeyValid(tbLicenseKey.Text))
            {
                try
                {
                    string key = gs.GetSettingValueOrDefault("LicenseKey", "");
                    lblLicenseInfo.Text  = "Aktualne dane licencyjne.\n";
                    lblLicenseInfo.Text += "\nWażna od: " + CryptLib.getDateFrom(key);
                    lblLicenseInfo.Text += "\nWażna do: " + CryptLib.getDateTo(key);
                    lblLicenseInfo.Text += "\nLiczba użytkowników: " + CryptLib.getNumOfUsers(key);
                    lblLicenseInfo.Text += "\nLiczba firm: " + CryptLib.getNumOfCompanies(key);
                }
                catch
                {
                    GlobalVariables.ShowMessage("Błąd w numerze licencji.", "Licencja - błąd", 3);
                }
            }
            else
            {
                lblLicenseInfo.Text = "Błędna licencja";
                GlobalVariables.ShowMessage("Błąd w numerze licencji.", "Licencja - błąd", 3);
            }
        }