private void button1_Click(object sender, EventArgs e) { //无参方式一 Thread thread = new Thread(display); thread.Start(); //无参方式二 Thread thread = new Thread(new ThreadStart(display)); thread.Start(); //带参方式一 Thread thread = new Thread(display); thread.Start("Name"); //带参方式二 Thread thread = new Thread(new ThreadStart(delegate () { display("Name", age); })); thread.Start(); } public void display() { //这里是执行的代码 } public void display(object Name) { //这里是执行的代码 } public void display(string Name,int age) { //这里是执行的代码 }
原帖地址:https://www.whg6.com/219.html