Esempio n. 1
0
 private void AboutBox1_Load(object sender, EventArgs e)
 {
     if (Properties.Settings.Default.License != Licensing.CPU())
     {
         textBoxDescription.Text += Environment.NewLine + $"Отсутствует лицензия. Осталось {(Licensing.StartDate().Date.AddDays(7) - DateTime.Today).Days} дней. ";
     }
 }
Esempio n. 2
0
 public static bool CheckLicense(string Cpu)
 {
     if (Properties.Settings.Default.License != Licensing.CPU())
     {
         Program.LicenseFlag = false;
         return(Math.Abs((DateTime.Now - StartDate()).Days) < 7);
     }
     else
     {
         Program.LicenseFlag = true;
         return(true);
     }
 }
Esempio n. 3
0
        static void Main()
        {
            //MessageBox.Show("bofore start");

            string CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Cache");

            if (!Directory.Exists(CachePath))
            {
                Directory.CreateDirectory(CachePath);
            }

            if (Licensing.CheckLicense(Properties.Settings.Default.License))
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                Cef.EnableHighDPISupport();

                try
                {
                    var settings = new CefSettings()
                    {
                        //By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data
                        CachePath = CachePath
                    };

                    //Perform dependency check to make sure all relevant resources are in our output directory.
                    Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);

                    Application.Run(new Form1());
                }
                catch (Exception err)
                {
                    MessageBox.Show($"{err.Message}");
                }
            }
        }
Esempio n. 4
0
 private void PictureBox4_Click(object sender, EventArgs e)
 {
     Hide();
     MessageBox.Show($"Для получения лицензии сообщите код {Licensing.CPU()} в службу поддержки");
     Close();
 }