我在C++里面,可以向线程函数传递参数值,C#怎么传递?请高手帮助

解决方案 »

  1.   

    你可以把新开的线程封装到一个类中,如:
            public class subClass
            {
                int a;
                public subClass(int intTemp)
                {
                    this.a = intTemp;
                }
                public void Thread1()
                {
                   //code
                }
            }
            public Form1()
            {
                InitializeComponent();
            }
            private void button1_Click(object sender, EventArgs e)
            {
                subClass a = new subClass(10);//参数10
                Thread t = new Thread(new ThreadStart(a.Thread1));
                t.Start();
            }
      

  2.   

    参看
    http://blog.csdn.net/knight94/archive/2006/03/21/631238.aspx