如何将textbox.text中内容以16进制保存在byte[]数组中.
例如:
textbox1.text="10";
byte[] mm=new byte[64];
mm[0]=0x0a //textbox1.text中内容以16进制保存在mm[0]中;
例如:
textbox1.text="10";
byte[] mm=new byte[64];
mm[0]=0x0a //textbox1.text中内容以16进制保存在mm[0]中;
char[] ch=new char[4];
怎么得到:
mm[0]=0x0a;
mm[1]=0xc2x;
mm[2]=0xb0;
各位大哥大姐帮下忙,在线等待,急切盼望中ing;
string _Text ="10";
long _Long = 0; byte[] mm = new byte[64];
if (long.TryParse(_Text, out _Long))
{
Array.Copy(BitConverter.GetBytes(_Long), mm, 8);
}
这样???
{
_Value[i] = Convert.ToByte(mm.Substring(i * 2, 2), 16);
} ...
byte[] mm=new byte[str.Length/2];
for (int i = 0; i < mm.Length; i++)
{
mm[i] = Convert.ToByte(str.Substring(i * 2, 2), 16);
}
*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) http://feiyun0112.cnblogs.com/
得到的_Value[0]=10;我说的是_Value[0]=0x0a.在麻烦看下,拜托
0x0a==10.........
问题解决了
揭贴了