Beispiel #1
0
 private void btnDecrypt_Click(object sender, EventArgs e)
 {
     try
     {
         EncryptInfo encrypt = new EncryptInfo(this.txtSource.Text, Encoding.GetEncoding(this.cbxEncode.SelectedValue.ToString()));
         encrypt.Iv  = this.txtIV.Text;
         encrypt.Key = this.txtKey.Text;
         IEncrypt obj       = (IEncrypt)CreateInstance("EncryptBLL.Encrypt" + this.cbxType.SelectedValue);
         string   checkeMsg = obj.Check(encrypt);
         if (string.Empty != checkeMsg)
         {
             MessageBox.Show(checkeMsg);
             return;
         }
         this.txtPassword.Text = obj.Dencrypt(encrypt);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }