您好,欢迎访问一九零五行业门户网

检查当前线程状态的 C# 程序

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 −
thread.isalive
examplelet 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
以上就是检查当前线程状态的 c# 程序的详细内容。
其它类似信息

推荐信息