65.9K
CodeProject is changing. Read more.
Home

textcoder

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.77/5 (12 votes)

Sep 1, 2014

GPL3
viewsIcon

20493

downloadIcon

179

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('-')");
                }
            }
//