Exemplo n.º 1
0
        private void myWindow_Loaded(object sender, RoutedEventArgs e)
        {
            string fullRegistryPath  = @"HKEY_CURRENT_USER\Software\Quasimodo Programs\BT";
            string registryValueName = "Key";

            string key = QP.GetRegister(fullRegistryPath, registryValueName);

            if (key != null && QP.IsLicensed(key, "BlueTimer.LicenseKeys.txt"))
            {
                QP._isLicensed = true;
                UnlockFull();
            }
            else
            {
                QP._isLicensed = false;

                this.Opacity = mDarkOpacity;
                Window_Buy win = new Window_Buy()
                {
                    Owner         = this,
                    ShowInTaskbar = false
                };
                win.ShowDialog();

                this.Opacity  = 1;
                ShowInTaskbar = true;
            }
        }
Exemplo n.º 2
0
        private void btn_Register_Click(object sender, RoutedEventArgs e)
        {
            if (QP.IsLicensed(tb_Password.Text, "BlueTimer.LicenseKeys.txt"))
            {
                string fullRegistryPath  = @"HKEY_CURRENT_USER\Software\Quasimodo Programs\BT";
                string registryValueName = "Key";

                QP.SetRegister(fullRegistryPath, registryValueName, tb_Password.Text);
                QP._isLicensed = true;
                MessageBox.Show("Successful registration");

                (Owner as MainWindow).UnlockFull();

                Close();
            }
            else
            {
                MessageBox.Show("The key is not licensed.");
            }
        }