private void button1_Click(object sender, EventArgs e) { try { if (radioButton_Code.Checked) { Squares s = new Squares(); string codeString = s.EncodeToSquaresCipher(richTextBox_Input.Text.ToUpper()); MessageBox.Show("Code in 4 Squares Cipher: " + codeString); Adfgvx a = new Adfgvx(); richTextBox_Output.Text = a.EncodeToAdfgvx(codeString); } else { Adfgvx a = new Adfgvx(); string decodeString = a.DecodeFromAdfgvx(richTextBox_Input.Text.ToUpper()); MessageBox.Show("Decode from Adfgvx Cipher: " + decodeString); Squares s = new Squares(); richTextBox_Output.Text = s.DecodeFromSquaresCipher(decodeString); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button2_Click(object sender, EventArgs e) { Adfgvx a = new Adfgvx(); if (!a.CheckCipher()) { MessageBox.Show("Error!"); } else { MessageBox.Show(a.ToString(), "ADFGVX table"); } }