Click here to Skip to main content
Click here to Skip to main content

Tagged as

textcoder

, 31 Aug 2014
Rate this:
Please Sign up or sign in to vote.
textcoder and textuncoder

Download source v1.1

Coding method based on text and data

simple code in c # , ASCII table, byte Convert ->Hex and Encoding->ASCII with Split('-');

//
        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, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

Share

About the Author

majid torfi

Iran (Islamic Republic Of) Iran (Islamic Republic Of)
No Biography provided

Comments and Discussions

 
GeneralMy vote of 1 PinpremiumKeith Barrow13hrs 11mins ago 
GeneralMy vote of 1 PinmemberMember 1098020715hrs 32mins ago 
GeneralMy vote of 1 PinprofessionalLostTheMarbles1-Sep-14 23:46 
GeneralMy vote of 1 PinmemberAlberto Molero1-Sep-14 9:32 
GeneralMy vote of 1 Pinmemberemrea1-Sep-14 8:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140903.1 | Last Updated 1 Sep 2014
Article Copyright 2014 by majid torfi
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid