using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
namespace Demo
{
class Program
{
[STAThread]
static void Main(string[] args)
{
Thread.CurrentThread.Name = "System Thread";
Console.WriteLine(Thread.CurrentThread.Name + " status: " + Thread.CurrentThread.ThreadState);
Console.ReadLine();
}
}
}C#简单线程示例
C#线程状态示例
最新推荐文章于 2020-02-10 22:11:08 发布
本文通过一个简单的C#示例程序展示了如何设置并获取当前线程的名字及状态。该程序利用了System命名空间下的Thread类来实现线程名称的设定与状态的输出。
598

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



