Esempio n. 1
0
        /// <summary>
        /// If in really application you will know registration type, so you will not need this function
        /// </summary>
        /// <returns></returns>
        private Boolean isRegistered()
        {
            Registration reg;

            reg = new RegistrationHash();

            Boolean result = reg.isRegistered();

            if (!result)
            {
                reg    = new RegistrationAsymmetric();
                result = reg.isRegistered();
            }

            return(result);
        }
Esempio n. 2
0
        private void btnRegisterHaskKey_Click(object sender, EventArgs e)
        {
            string regName = textBoxName.Text;
            string regKey  = textBoxKey.Text;

            registration = new RegistrationHash();

            if (registration.keyValid(regName, regKey))
            {
                registration.registerApp(regName, regKey);
                MessageBox.Show("Program registered. Thank you", "Attention!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
            else
            {
                MessageBox.Show("Key Invalid!", "Attention!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }