Esempio n. 1
0
        static void Main(string[] args)
        {
            MagicSquare magicSquare = new MagicSquare();

            Console.WriteLine(magicSquare.Encrypt(Line));
            Console.WriteLine(magicSquare.magicSquareString);
            Console.WriteLine(magicSquare.resultMagicSquareString);
            Console.WriteLine(magicSquare.Decrypt(magicSquare.Encrypt(Line), magicSquare.magicSquare));
            Console.ReadKey();
        }
Esempio n. 2
0
        private void SquareEncryptButton_Click(object sender, RoutedEventArgs e)
        {
            EncryptedMagicStringLabel.Content = "";
            MagicSquareTextLabel.Content      = "";
            DecryptedMagicStringLabel.Content = "";
            MagicSquareLabel.Content          = "";

            if (MagicStringToEncodeBox.Text == null)
            {
                MessageBox.Show("Неверный ввод строки для шифрования.", "Ошибка");
            }
            else
            {
                magicSquare = new MagicSquare();

                EncryptedMagicStringLabel.Content = "Encrypted string: " + magicSquare.Encrypt(MagicStringToEncodeBox.Text);
                MagicSquareLabel.Content          = magicSquare.magicSquareString;
                MagicSquareTextLabel.Content      = magicSquare.resultMagicSquareString;
            }
        }