private void btnOK_Click(object sender, EventArgs e) { this.DialogResult = System.Windows.Forms.DialogResult.OK; if (cmbxMethod.SelectedIndex == 0) { this.Name = "Basic " + MisterCoder.Base64Encode(txbxUsername.Text + ":" + txbxPass.Text); } else { this.Name = "%Digest%(%" + txbxUsername.Text + "%:%" + txbxPass.Text + "%)"; } this.Close(); }
private void btnEnc_Click(object sender, EventArgs e) { richTextBox_String.Text = MisterCoder.Base64Encode(richTextBox_Result.Text); }
private void btnDec_Click(object sender, EventArgs e) { string outed = ""; if (Base64Decode.Checked) { outed = MisterCoder.Base64Decode(richTextBox_String.Text); } else if (Base64Encode.Checked) { outed = MisterCoder.Base64Encode(richTextBox_String.Text); } else if (URLEncode.Checked) { outed = MisterCoder.UrlEncode(richTextBox_String.Text); } else if (URLDecode.Checked) { outed = MisterCoder.Base64Decode(richTextBox_String.Text); } else if (HTMLEncode.Checked) { outed = MisterCoder.HtmlEncode(richTextBox_String.Text); } else if (HTMLDecode.Checked) { outed = MisterCoder.HtmlDecode(richTextBox_String.Text); } else if (FromAscii.Checked) { string sep = (comboBox_FromAscii.SelectedIndex == 0)?" ":comboBox_FromAscii.SelectedItem.ToString(); if (richTextBox_String.Text.Contains(sep)) { outed = MisterCoder.FromAscci(richTextBox_String.Text, sep); } else { this.Notify("Separator not found on text , plz change it "); } } else if (ToAscii.Checked) { string sep = ""; if (comboBoxToAscii.SelectedItem != null) { sep = (comboBoxToAscii.SelectedIndex == 0) ? " " : comboBoxToAscii.SelectedItem.ToString().Trim(); } if (checkBox_Use_separatorToAscii.Checked == false) { sep = ""; } outed = MisterCoder.ToAscii(richTextBox_String.Text, sep); } richTextBox_Result.Text = outed; this.Notify("Done"); }