疯掉的拼接
//if (flag)
//{
bytReceiveArray = e.Data;
// flag = false;
// num = bytReceiveArray.Length / by.Length;
// renum = bytReceiveArray.Length % by.Length;
//}
//else
//{
// bytReceiveArray = new byte[rebyte.Length+ e.Data.Length];
// Array.Copy(rebyte, 0, bytReceiveArray, 0, rebyte.Length);
// Array.Copy(e.Data, 0, bytReceiveArray, renum, e.Data.Length);
// num = sendnum- num;
// renum = 0;
// }
byte[] tmp = new byte[by.Length];//接受单条信息的数组
SampRepInfor samp = new SampRepInfor();
int sourceIndex = 0;
// Array.Copy(源数据, 源数据开始复制处索引, 接收数据, 接收数据开始处索引, 复制多少个数据);
for (int i = 0; i < num; i++)
{
Array.Copy(bytReceiveArray, 0, tmp, 0, by.Length);
samp = BytesToParaHelper.BytesToPara(tmp);
if (samp.ID != 0)
{
Table = ParaToDataTableHelper.ConvertToDataTable(samp,dt);
}
sourceIndex = sourceIndex + by.Length;
}
//if (renum!=0)
//{
// //剩余的值存起来
// Array.Copy(bytReceiveArray, by.Length * num, rebyte, 0, renum);
//}