Expand|Select|Wrap|Line Numbers
- private void button2_Click(object sender, EventArgs e)
- {
- int i;
- int a=0;
- byte[] mychar;
- mychar = new byte[128];
- string M = textBox1.Text;
- for (i = 0; i < 127; i++ ) {
- mychar[i] = Convert.ToByte((M.Substring(a,2)),16);
- a += 2;
- }
- serialPort1.Write(mychar,0,127);
- }
Expand|Select|Wrap|Line Numbers
- private void displaytext(object s, EventArgs e)
- {
- textBox5.Clear();
- textBox5.AppendText(RXstring);
- //int value = Convert.ToInt32(RXstring, 16);
- //string stringValue = Char.ConvertFromUtf32(value);
- //textBox4.AppendText(stringValue);
- }
1- Is the code to send data is correct?
2- How can I force the textbox to show the output as Hex?
thank you very much.