Exemple #1
0
        private void DecrText_Click(object sender, RoutedEventArgs e)
        {
            Form1.Items.Clear();

            WordSearch wordSearch = new WordSearch();

            string dictionary = "C:\\io\\dictionary.txt";

            dictionary = wordSearch.UnloadText(dictionary);

            string text = "C:\\io\\Result.txt";

            text = wordSearch.UnloadText(text);

            string[] textSplit = text.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

            Decryption decryption = new Decryption();
            Encryption encryption = new Encryption();

            List <string> wordList = decryption.DecryptWord(textSplit[3]);
            int           shift    = wordSearch.Search(dictionary, wordList);

            string decrypText = decryption.DecryptWithIset(text, shift);

            Form1.Items.Add(decrypText);
        }
Exemple #2
0
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            Decryption decryption = new Decryption();
            WordSearch wordSearch = new WordSearch();
            SaveText   saveText   = new SaveText();
            string     way        = positionBox.Text;
            string     text       = "C:\\io\\Result.txt";

            text = wordSearch.UnloadText(text);
            text = decryption.DecryptWithIset(text, 2);
            saveText.Сreate(way, text);
            MessageBox.Show("Запись создана! ");
        }
Exemple #3
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            try
            {
                Form1.Items.Clear();
                Decryption decryption = new Decryption();
                var        text       = TextBox.Text;
                var        shift      = Convert.ToInt32(ShiftBox.Text);
                string     word       = decryption.DecryptWithIset(text, shift);

                Form1.Items.Add(word);
            }
            catch (System.FormatException)
            {
                MessageBox.Show("Error...\n You wrote something wrong!");
            }
        }