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 SquareDecryptButton_Click(object sender, RoutedEventArgs e)
        {
            DecryptedMagicStringLabel.Content = "";

            if (EncryptedMagicStringLabel.Content == null)
            {
                MessageBox.Show("Строка для дешифорвания отсутствует.", "Ошибка");
            }
            else
            {
                DecryptedMagicStringLabel.Content = "Decrypted string: " + magicSquare.Decrypt(EncryptedMagicStringLabel.Content.ToString().Replace("Encrypted string: ", ""), magicSquare.magicSquare);
            }
        }