コード例 #1
0
        /// <summary>
        ///     Дешифрует выбранный файл со сдвигом (Цезарь)
        /// </summary>
        /// <param name="shift">Числовой сдвиг</param>
        public static void DecodeFile(int shift)
        {
            string path = PickUpFile();

            Worker.ExecuteBW((o, args) =>
            {
                string result = EncoderDecoder.Decode(File.ReadAllText(path, Encoding.UTF8), shift);
                File.WriteAllText(path, result, Encoding.UTF8);
            },
                             (o, args) => { MessageBox.Show("Decoding Done!"); });
        }
コード例 #2
0
 private void Decode_btn_Click(object sender, EventArgs e)
 {
     try
     {
         richTextBox_output.Text = EncoderDecoder.Decode(richTextBox_input.Text, int.Parse(textBox_shift.Text));
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, ex.Source, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }