public InstallUpdateLicenseForm()
        {
            InitializeComponent();

            string license = Path.Combine(MOG_Main.GetExecutablePath_StripCurrentDirectory(), "mog_license");

            if (File.Exists(license))
            {
                MOG_TimeBomb timeBomb = new MOG_TimeBomb(license);
                PopulateLicenseInfo(timeBomb, "MOG_License");
            }
            else
            {
                LicenseRichTextBox.Text  = "";
                LicenseRichTextBox.Text += "UnLicenced Server\n";
                LicenseRichTextBox.Text += "Total UnLicensed Connections: 4 \n\n";
            }
        }
        private void LoadLicenseFile()
        {
            if (LicenseOpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                MOG_TimeBomb timeBomb = new MOG_TimeBomb(LicenseOpenFileDialog.FileName);
                if (PopulateLicenseInfo(timeBomb, LicenseOpenFileDialog.FileName))
                {
                    try
                    {
                        string installedLicense = Path.Combine(MOG_Main.GetExecutablePath_StripCurrentDirectory(), "mog_license");
                        File.Copy(LicenseOpenFileDialog.FileName, installedLicense, true);

                        MessageBox.Show(string.Format("Restart your server for this new license file to take effect"), "MOG License");
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show(string.Format("Unable to deploy license file with error {0}!", e.Message), "MOG License");
                    }
                }
            }
        }
Esempio n. 3
0
 public MOG_License()
 {
     mTimeBomb = new MOG_TimeBomb(String.Concat(MOG_Main.GetExecutablePath_StripCurrentDirectory(), "\\mog_license"));
 }