byte[] buf = new byte[16]; int i; i = int.Parse(textBox1.Text); byte[] ss = System.BitConverter.GetBytes(i); for (i = 0; i < ss.Length; i++) { buf[i] = ss[i]; } 这样写的,但是输出的不对啊。textbox1的值为1的时候,转换出来的数是07,再输出就成700了,错在那里了?怎么改?
//byte[] buf = new byte[16]; int i;
i =int.Parse(textBox1.Text);
byte[] ss = System.BitConverter.GetBytes(i);
byte[] buf =newbyte[ss.Length -1];
for (i =0; i < ss.Length; i++)
{
buf[i] = ss[i];
}