How do you get list of running threads in C#?

后端 未结 5 1115
眼角桃花
眼角桃花 2021-02-01 11:12

I create dynamic threads in C# and I need to get the status of those running threads.

List[] list;
list = dbConnect.Select();

for (int i = 0; i &l         


        
5条回答
  •  耶瑟儿~
    2021-02-01 11:25

    Process.GetCurrentProcess().Threads
    

    This gives you a list of all threads running in the current process, but beware that there are threads other than those you started yourself.

提交回复
热议问题