间接传替参数
public void test(string str1,string str2)
{
 .......函数实现部分
}
public void dowork()
{
test(a,b);
}
System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(dowork());
t.Start();

解决方案 »

  1.   

    MSDN
    向线程传递数据
    ThreadStart 委托既没有参数也没有返回值。这意味着不可以使用需要参数的方法启动线程,或从方法中获得返回值。 为向线程传递数据,需要创建一个用来保持数据和线程方法的对象,如下面的[C#]
    using System;
    using System.Threading;// The ThreadWithState class contains the information needed for
    // a task, and the method that executes the task.
    //
    public class ThreadWithState {
        // State information used in the task.
        private string boilerplate;
        private int value;    // The constructor obtains the state information.
        public ThreadWithState(string text, int number) {
            boilerplate = text;
            value = number;
        }
               
        // The thread procedure performs the task, such as formatting 
        // and printing a document.
        public void ThreadProc() {
            Console.WriteLine(boilerplate, value); 
        }
    }// Entry point for the example.
    //
    public class Example {
        public static void Main() {
            // Supply the state information required by the task.
            ThreadWithState tws =
                new ThreadWithState("This report displays the number {0}.", 42);
            // Create a thread to execute the task, and then
            // start the thread.
            Thread t = new Thread(new ThreadStart(tws.ThreadProc));
            t.Start();
            Console.WriteLine("Main thread does some work, then waits.");
            t.Join();
            Console.WriteLine("Independent task has completed; main thread ends.");  
        }
    }