private void fromTextBoxToolStripMenuItem1_Click(object sender, EventArgs e) { XORParams frm = new XORParams(true); frm.ShowDialog(); string Key = frm.GetSecretKey(); if (Key.Length == 0) { return; } textBox2.Text = Shifrator.CaesarRU(textBox1.Text, Int32.Parse(Key)); }
private void fromFileToolStripMenuItem1_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { XORParams frm = new XORParams(true); frm.ShowDialog(); string Key = frm.GetSecretKey(); if (Key.Length == 0) { return; } using (StreamReader rdr = new StreamReader(openFileDialog1.FileName)) { textBox2.Text = Shifrator.CaesarRU(rdr.ReadToEnd(), Int32.Parse(Key)); } } }