Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

textcoder

0.00/5 (No votes)
31 Aug 2014 1  
textcoder and textuncoder

There are different methods for encrypting texts. But I have tried the simple way ,However I applied for combined text and color.This piece of software is the version 0.0 of the program i written .

Quote:

I Just trying to convert ASCII to hex and reverse.I hope this simple program help you.

  1. Convert text (ASCII table) to Hex 
  2. byte Convert ->Hex and Encoding->ASCII with Split('-');

if you want save your text in image you can see this Tips/Trick

//
        private void button1_Click(object sender, EventArgs e)
        {
            if (dcodingToolStripMenuItem.Checked == false)
            {
                byte[] table = { 1, 2 };

                for (int i = 0; i <= richTextBox1.Lines.Length - 1; i++)
                {
                    string n = richTextBox1.Lines[i];
                    string myHexString = BitConverter.ToString(Encoding.ASCII.GetBytes(n));  //base
                    //myHexString.ToCharArray();
                    myHexString.ToString(); //base
                    listBox1.Items.Add(myHexString);
                    //listBox1.Items.Add(n_int);
                }
            }
            if (dcodingToolStripMenuItem.Checked == true)
            {
              try
                {

                for (int i = 0; i <= richTextBox1.Lines.Length - 1; i++)
                {
                    string n = richTextBox1.Lines[i];
                    string[] parts = n.Split('-');
                    decode2 = "";
                    for (int i2 = 0; i2 <= parts.Length - 1; i2++)
                    {
                        // int g = int.Parse("6f");
                        if (parts[i2] != "")
                        {
                            int value = Convert.ToInt32(parts[i2], 16);
                            decode2 += Convert.ToChar(value);
                        }

                    }

                    // string myHexString = BitConverter.ToString(Encoding.ASCII.GetBytes(n));
                    listBox1.Items.Add(decode2);
                }

         }
                catch
                {
                    MessageBox.Show("not find Split('-')");
                }
            }
//

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here