public void onReceive(byte commId, byte terId, byte zoneId, byte alarmType)
{
//将参数打包
byte[] bytes = new byte[]{ commId,terId,zoneId,alarmType};
Thread t = new Thread(new ParameterizedThreadStart(onReceiveReal));
t.Start(bytes);
}
//重载要执行的方法
private void onReceiveReal(object o)
{
byte[] a = new byte[4];
a = (byte[])o;
onReceiveReal(a[0],a[1],a[2],a[3]);
}
private void onReceiveReal(byte commId, byte terId, byte zoneId, byte alarmType)
{
}
C#线程中执行多个参数的方法
最新推荐文章于 2023-06-01 11:28:11 发布