// 接收数据
byte[] buffer = null;
byte[] data = new byte[2048];
int receiveCount = 0;
while (true)
{
System.Threading.Thread.Sleep( 20 );
if(SP_ReadData.BytesToRead < 1)
{
buffer = new byte[receiveCount];
Array.Copy( data, 0, buffer, 0, receiveCount );
break;
}
receiveCount = SP_ReadData.Read( data, receiveCount, SP_ReadData.BytesToRead );
}