Beispiel #1
0
        public static void LoadLicData()
        {
            try
            {
                string lLicData = Convert.ToString(Get("", "LicData")).Trim();
                if (String.IsNullOrEmpty(lLicData))
                {
                    LicData.Clear();

                    // Set Default data - Demo
                    LicData.Add("LicNumberCheck", "True");
                    LicData.Add("LicNumberValue", "10");
                    LicData.Add("CustomerID", ThumbPrint.Value());
                    LicData.Add("TimeLimitCheck", "True");
                    LicData.Add("TimeLimitDate", DateTime.Now.AddDays(30).ToString("yyyy-MM-ddT00:00:00"));
                    LicData.Add("AppRegSrv", "appreg.mr-avtomatika.com");
                    LicData.Add("RegCode", "DEMO");
                    LicData.Add("LicProgram", "s24WebPOS DEMO");
                    LicData.Add("naziv", "Nova DEMO");
                    LicData.Add("naziv_dolg", "");
                    LicData.Add("telefon", "");
                    LicData.Add("email", "");
                    LicData.Add("naslov", "");
                    LicData.Add("spletna_stran", "");
                    LicData.Add("zavezanec", "False");
                    LicData.Add("davcna", "");
                    LicData.Add("obvescanje", "False");
                    LicData.Add("osvezevanje", "False");
                    LicData.Add("Modules", "");

                    string lData = ExportLicData(LicData);
                    if (lData.Length > 0)
                    {
                        string lEncData = Varnost.EncryptAES256_Lic(lData);
                        SaveLicData(lEncData, 99999);
                    }
                }
                else
                {
                    string ldecData = Varnost.DecryptAES256_Lic(lLicData);
                    LicData.Clear();
                    LicData = ImportLicData(ldecData);
                }
            }
            catch (Exception exception)
            {
                cLog.WriteError("Get Settings: " + exception.Message);
            }
        }
Beispiel #2
0
        public static Boolean CheckRegCode(string pRegCode)
        {
            Boolean lResponse = false;

            try
            {
                string lrsp1 = ThumbPrint.Value();
                string lrsp2 = Varnost.GatSHA256Hash_S(lrsp1);
                if (lrsp2 == pRegCode)
                {
                    lResponse = true;
                }
            }
            catch
            { }

            return(lResponse);
        }