
To check the status of the current thread in C#, use the IsAlive property.
Firstly, use the currentThread property to display information about a thread −
Thread thread = Thread.CurrentThread;
Now use the thread.IsAlive property to check the status of the thread −
思远企业网站管理系统是由思远负责人结合多年的开发精髓为企业量身订做的一套全国通用版本的企业网站 管理系统,该系统体积小,代码执行速度快,用户操作相当简单而深受大家的喜爱。 版本说明:程序采用asp.net(c#)+access(节约企业资源) 1:网站由后台全静态生成前台所有页面,简化操作,一键即可生成大型企业网站 2:网站栏目灵活控制:是为企业量身订做的企业网站,通过模板自由生成各行各业大型企业
thread.IsAlive
Example
Let us see the complete code to check the status of current thread in C#.
Live Demo
using System;
using System.Threading;
namespace Demo {
class MyClass {
static void Main(string[] args) {
Thread thread = Thread.CurrentThread;
thread.Name = "My New Thread";
Console.WriteLine("Thread Status = {0}", thread.IsAlive);
Console.ReadKey();
}
}
}输出
Thread Status = True









