Пример #1
0
        private void Shift_Click(object sender, EventArgs e)
        {
            CaesarCipher plainToCipher = new CaesarCipher();
            if (mode == true)
            {
                try
                {
                    cipherText.Text = plainToCipher.CipherAllCharacter(Convert.ToInt16(shiftText.Text), plainText.Text);
                }
                catch (Exception execeptionOne)
                {
                    MessageBox.Show("Please fill in all blanks.\n-----------------------\n" + execeptionOne.ToString());
                }
            }
            else
            {
                try
                {
                    cipherText.Text = plainToCipher.CipherAlphabetOnly(Convert.ToInt16(shiftText.Text), plainText.Text);

                }
                catch (Exception execeptionTwo)
                {
                    MessageBox.Show("Please fill in all blanks.\n-----------------------\n" + execeptionTwo.ToString());
                }
            }
        }
Пример #2
0
        private void Shift_Click(object sender, EventArgs e)
        {
            CaesarCipher plainToCipher = new CaesarCipher();

            if (mode == true)
            {
                try
                {
                    cipherText.Text = plainToCipher.CipherAllCharacter(Convert.ToInt16(shiftText.Text), plainText.Text);
                }
                catch (Exception execeptionOne)
                {
                    MessageBox.Show("Please fill in all blanks.\n-----------------------\n" + execeptionOne.ToString());
                }
            }
            else
            {
                try
                {
                    cipherText.Text = plainToCipher.CipherAlphabetOnly(Convert.ToInt16(shiftText.Text), plainText.Text);
                }
                catch (Exception execeptionTwo)
                {
                    MessageBox.Show("Please fill in all blanks.\n-----------------------\n" + execeptionTwo.ToString());
                }
            }
        }