private void button1_Click(object sender, EventArgs e) { Crypt crypt = new Crypt(); if (tbString.Text !="") { tbEncrypt.Text = crypt.Encryption(tbString.Text); } else { MessageBox.Show("请输入字符串"); } }
private void DecryptBtn_Click(object sender, EventArgs e) { try { Crypt crypt = new Crypt(); if (tbEncrypt.Text != "") { tbDecrypt.Text = crypt.Decryption(tbEncrypt.Text); } else { MessageBox.Show("请输入加密后的字符串"); } } catch (Exception) { MessageBox.Show("无法识别的字符...解密失败!"); } }
private void PwdCryptBtn_Click(object sender, EventArgs e) { Crypt crypt = new Crypt(); if (tbString.Text != "") { tbEncrypt.Text = crypt.EncryptPassword(tbString.Text); } else { MessageBox.Show("请输入字符串"); } }