发布时间:2025-12-09 13:42:33 浏览次数:4
TreadStart委托仅仅指向无参数且无返回值的方法。
如果新线程上运行带参数的方法,那么需要用到ParameterizedThreadStart委托,
ParameterizedThreadStart定义:public delegate void ParameterizedThreadStart(object obj);
一:要求只能有一个参数,且为object类型
二:无返回值
Thread th=new Thread(Test)和Thread th =new Thread(ParameterizedThreadStart(Test))一样。
转载于:https://www.cnblogs.com/selfcontrol/p/9815980.html