| 发表于:2007-03-12 15:11:35 楼主 |
使用线程池后台运行任务,想给这个方法传两个以上的参数的话,用以下的方法可不可以: public class workservice { private string id; private int count; public reqservice(string id, int count, ) { this.id = id; this.count = count; } public void dowork(object stateinfo) { ... } } public class someclass { public void somemethod() { ... workservice workservice = new workservice( " ", 0);// " "、0想传递的参数 threadpool.queueuserworkitem(new waitcallback(workservice.dowork)); } } |
|
|
|
|