线程在C#线程

2023-09-04 06:34:56 作者:南巷初晴

只是寻找一些超简单。我需要生成一个方法开了一个新的线程。

在我没有怎么在意结束时或。

有人可以请帮助我?

感谢您

解决方案

 线程的线程=新主题(()=> {
  //线程code在这里
});

thread.Start();
 

跨线程访问

Just looking for something ultra simple. I need to spawn a method off to a new thread.

I don't care when or how it ends.

Can somebody please help me with this?

Thank you

解决方案

Thread thread=new Thread(() => {
  // thread code here
});

thread.Start();