示例#1
0
 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);
     }
 }
示例#2
0
        private void button3_Click(object sender, EventArgs e)
        {
            Squares s = new Squares();

            MessageBox.Show(s.ToString(), "4 Squares");
        }