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(); }
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; } }