private void buttonDecompress_Click(object sender, EventArgs e) { try { string testing = richTextBoxDecryption.Text; byte[] compressedBytes = Encoding.Default.GetBytes(testing); BitArray bitArray = new BitArray(compressedBytes); Compression cmpr = new Compression(); string arrnged = cmpr.ArrangeString(bitArray); richTextBoxDecryption.Text = cmpr.DeCoding(arrnged); MessageBox.Show("System has Decompressed the Encrypted text\n\nPress OK to proceede "); buttonDecompress.Enabled = false; buttonDecrypte.Enabled = true; } catch (Exception ex) { MessageBox.Show("System Can not Decompress your Message \n\nException:\n" + ex.Message + "\n\nPress OK to Proceede"); } }