コード例 #1
0
        private void LaunchButton_Click(object sender, EventArgs e)
        {
            FileInfo licenseFile = new FileInfo(GetLicenseFilePath());

            if (!licenseFile.Exists)
            {
                InvalidLicense();
                return;
            }

            string code  = string.Empty;
            bool   valid = HorizonLicenses.CheckForLicense("Alpha", licenseFile.FullName, ref code);

            if (!valid)
            {
                MessageBox.Show(this, "Invalid license: " + HorizonLicenses.LastError, "License Error", MessageBoxButtons.OK);
                return;
            }

            string binPath = Path.Combine(GameDir.FullName, "bin");

            ProcessStartInfo startInfo = new ProcessStartInfo();

            startInfo.Arguments        = "";
            startInfo.FileName         = "Horizons.exe";
            startInfo.UseShellExecute  = true;
            startInfo.WorkingDirectory = binPath;
            startInfo.CreateNoWindow   = true;
            this.WindowState           = FormWindowState.Minimized;

            Process.Start(startInfo);

            Close();
        }
コード例 #2
0
        internal static string GetProductCode()
        {
            string pCode = string.Empty;

            HorizonLicenses.CheckForLicense("Alpha", GetLicenseFilePath(), ref pCode);
            return(pCode);
        }
コード例 #3
0
        private bool ValidateLicense()
        {
            bool ret = HorizonLicenses.CheckForLicense("Alpha", GetLicenseFilePath(), ref UpMan.ProductCode);

            if (!ret)
            {
                InvalidLicense();
            }

            return(ret);
        }