Thread之ParameterizedThreadStart

发布时间: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

需要做网站?需要网络推广?欢迎咨询客户经理 13272073477