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)
{
//这里是执行的代码
}
感谢您的来访,获取更多精彩文章请收藏本站。

THE END
暂无评论内容