static void Main(string[] args)
{
Thread thread = new Thread(() =>
{
OneTest("a", "b", 666, new Program());
});
thread.Name = "Test";
thread.Start();
Console.ReadKey();
}
public static void OneTest(string a, string b, int c, Program p)
{
Console.WriteLine("新的线程已经启动");
}
.net core 启动线程带参数
最新推荐文章于 2025-03-05 00:33:17 发布
本文提供了一个使用C#创建并启动新线程的基本示例。示例中定义了一个名为OneTest的方法,并通过Thread类实例化了一个新线程来调用此方法,展示了如何设置线程名称及启动线程。
2516

被折叠的 条评论
为什么被折叠?



