private void btnCrack_Click(object sender, EventArgs e) { try { if (Directory.Exists(txtUrl.Text)) { switch (this.cbVer.SelectedIndex) { case 0: EncryptLicenseData(string.Format(_license, txtUsers.Text), _encryptionKeyBytes[0], Path.Combine(txtUrl.Text, licenseFile[0])); break; case 1: RegAckMsg regAckMsg = new RegAckMsg { AllowedUserCount = Int32.Parse(txtUsers.Text) }; EncryptXmlData(regAckMsg.ToString(), txtMachine.Text, _encryptionKeyBytes[1], licenseFile[1]); break; } MessageBox.Show("破解成功"); } else { MessageBox.Show("请选择正确的安装路径!"); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }