private void btnReadBlock_Click(object sender, EventArgs e) { tbBlockData.Text = ""; tbBlockData.Refresh(); byte ctl; string ret; byte seq = 1; string id = tbReadBlockID.Text; Protocol645 p645 = new Protocol645(); if (p645.ReadBlockData(id, out ctl, out ret)) { tbBlockData.AppendText("第" + seq.ToString() + "帧数据(" + ret.Length / 2 + "字节):\r\n"); tbBlockData.AppendText(ret + "\r\n---------------------------------\r\n"); if (ctl == 0xb1) { do { if (p645.ReadNextBlock(id, seq, out ctl, out ret)) { tbBlockData.AppendText("第" + (seq + 1).ToString() + "帧数据(" + ret.Length / 2 + "字节):\r\n"); tbBlockData.AppendText(ret + "\r\n---------------------------------\r\n"); seq++; } else { break; } } while (ctl == 0xb2); } } }