如代码 : foreach (OperationList operationlist1 in resultList)
{
// MessageBox.Show(operationlist1.ShowMessage);
if (operationlist1.ShowMessage.Contains(buffer))
{
this.dataGridView1.Rows[i].Cells[2].Value = buffer;
this.dataGridView1.Rows[i].Cells[3].Value = "pass";
nteststatus = int.Parse(operationlist1.TestSeq);
Thread.Sleep(1000);
break;
}
else
{
this.dataGridView1.Rows[i].Cells[2].Value = buffer;
this.dataGridView1.Rows[i].Cells[3].Value = "fail";
nteststatus = int.Parse(operationlist1.TestSeq);
Thread.Sleep(100);
}
}
buffer:串口会有返回值,按照顺序假设buffer1,buffer2,buffer3。。。。。
operationlist1.ShowMessage:初始化存在xml文件里(其实相当于buffer的值),也是按照顺序排:ShowMessage1,ShowMessage2,ShowMessage3(分别相对应buffer1,buffer2,buffer3)
把break删掉,