C#中的线程状态 [英] thread state in c#
本文介绍了C#中的线程状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何获取线程的线程状态?
how to get threadstate of my thread?
推荐答案
小 ^ ]将为您提供帮助.
HTH
Little googling[^] will help you.
HTH
使用其 ThreadState [^ ]属性. :)
示例:
By using its ThreadState[^] property. :)
Example:
public static void Main()
{
Thread thread = Thread.CurrentThread;
Console.WriteLine ("ThreadState: {0}", thread.ThreadState);
}
程序输出:线程状态:正在运行
Output of the program: ThreadState: Running
这篇关于C#中的线程状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文