コード例 #1
0
ファイル: License.xaml.cs プロジェクト: ORRNY66/GS
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Activation activation = new Activation();
            this.ActivationCode.Text = activation.GetActivationCode();

             ActivationManager am = ActivationManager.GetInstance();

             this.Key.Text = am.GetKey();

            if (am.ActivationStatus())
            {
                this.lbl_left.Visibility = Visibility.Collapsed;
                this.Key.IsEnabled = false;
                this.RegisterButtonsPanel.Visibility = Visibility.Collapsed;
            }
            else
            {
                int daysleft = 30 - am.CountDays();

                if (daysleft > 0)
                {
                    this.lbl_left.Content = "Unregistered version you have " + daysleft.ToString() + " days left";
                }
                else
                {
                    this.lbl_left.Content = "Please register you have used your 30 days trial period";
                }

            }
        }
コード例 #2
0
ファイル: ActivationManager.cs プロジェクト: ORRNY66/GS
        public bool ActivationStatus()
        {
            Activation activation = new Activation();

            string key = SettingsManager.ReadSetting("ActivationKey");

            string code = activation.GetActivationCode();

            string correctkey = activation.ThisComputerKey();

            if (correctkey == key)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
コード例 #3
0
ファイル: License.xaml.cs プロジェクト: ORRNY66/GS
        private void VerifyKey_Click(object sender, RoutedEventArgs e)
        {
            Activation activation = new Activation();

            string correctkey = activation.ThisComputerKey();

            string key = this.Key.Text;

            if (key == correctkey)
            {
                SettingsManager.UpdateSetting("ActivationKey", key);
                MessageBox.Show("Activation Successful");
                this.Close();
            }
            else
            {
                MessageBox.Show("The key is wrong, try again...");
            }
        }
コード例 #4
0
ファイル: ActivationManager.cs プロジェクト: ORRNY66/GS
        public string GetKey()
        {
            Activation activation = new Activation();

            return SettingsManager.ReadSetting("ActivationKey");
        }
コード例 #5
0
ファイル: MainWindow.xaml.cs プロジェクト: ORRNY66/GS
        private void Generate_Click(object sender, RoutedEventArgs e)
        {
            Activation activation = new Activation();

            this.Key.Text=activation.GenerateKeyFromCode(this.ActivationCode.Text);
        }