I've got the below code. What I'm trying to do is get the values entered by the user into textbox4 and place them into a byte array.
But it's not working right. Once I go over the value of 255 into the text box I do not get the correct value displayed in the console when i try adding OUTBuffer + OUTBuffer.
private void button1_Click(object sender, EventArgs e)
Byte OUTBuffer = new byte;
int decValue = Convert.ToInt16(textBox4.Text);
OUTBuffer = 0;
OUTBuffer = 0x80;
byte intBytes = BitConverter.GetBytes(decValue);
Array.Copy(intBytes, 0, OUTBuffer, 2, intBytes.Length);
Console.WriteLine(OUTBuffer + OUTBuffer);
Any help here will be appreciated.