コード例 #1
0
        // To decrypt user message
        private void decrypt_btn_Click_1(object sender, EventArgs e)
        {
            label1.Visible = true;
            label1.Enabled = true;

            try
            {
                if (!String.IsNullOrWhiteSpace(encTextBox.Text))
                {
                    label1.Text      = "Decrypted message: " + encService.Decrypt(encTextBox.Text); //Calls Decrypt method of Encryption Service
                    copy_btn.Enabled = true;
                    label1.ForeColor = Color.Black;
                }

                else
                {
                    label1.Text      = "Please enter a message to Encrypt/Decrypt";
                    label1.ForeColor = Color.Red;
                }
            }
            catch (Exception ex)
            {
                label1.Text      = ex.Message;
                label1.ForeColor = Color.Red;
            }
        }
コード例 #2
0
 private void btnDecrypt_Click(object sender, EventArgs e) //Decrypt onclick
 {
     EncryptionService.ServiceClient proxy = new EncryptionService.ServiceClient();
     lblDecrypt.Text = proxy.Decrypt(this.lblEncryptResult.Text);
 }