//定义委托
public void threadHand1_Run(DateTime? timeStart, DateTime? timeEnd)
{
}
//调用
threadHand1 = new Thread(new ThreadStart(threadHand1_Run(timeStart,timeEnd)));
threadHand1.Start();这样报错,提示错误“应输入方法名称”
请问一下ThreadStart该怎么传递两个参数呢?

解决方案 »

  1.   

    本帖最后由 Sandy945 于 2011-11-10 11:07:16 编辑
      

  2.   

    orthreadHand1 = new Thread(delegate(){threadHand1_Run(timeStart,timeEnd);});
    threadHand1.Start(); 
      

  3.   

      threadHand1 = new Thread(new ThreadStart()=>
                        {
                        threadHand1_Run(timeStart,timeEnd);
                        });
                        threadHand1.Start();
    这样么?
    还是报错呀
      

  4.   

    threadHand1 = new Thread(new ParameterizedThreadStart(delegate {threadHand1_Run(timeStart,timeEnd);}));
    threadHand1.Start();
      

  5.   

    =>
    不能被识别呀
    无效的表达式项“>”
      

  6.   

    public void A(object 参数);therad mytherad=new therad(A);mythread.start((object)要传得东西);