private void button2_Click(object sender, EventArgs e)
 {
     if (txtDescriptografar.Text.Length != 0)
     {
         ConexaoCriptografada.ConexaoBancoDados cs = new ConexaoCriptografada.ConexaoBancoDados();
         txtCriptografar.Text    = txtDescriptografar.Text;
         txtDescriptografar.Text = cs.DecryptConnectionString();
     }
 }
        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection conn = null;

            try
            {
                ConexaoCriptografada.ConexaoBancoDados cs = new ConexaoCriptografada.ConexaoBancoDados();
                conn = new SqlConnection(cs.DecryptConnectionString());
                conn.Open();
                MessageBox.Show("Conectado com sucesso.");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
            finally
            {
                conn.Close();
            }
        }