C#线程中执行多个参数的方法
作者:互联网
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)
{
}
BMKB
发布了5 篇原创文章 · 获赞 0 · 访问量 39
私信
关注
标签:terId,C#,commId,onReceiveReal,zoneId,参数,new,线程,byte 来源: https://blog.csdn.net/q446002320/article/details/104520837