如何查询获取其他进程及所含线程的状态

2025-05-07 12:26:43
推荐回答(1个)
回答1:

Process[] arr = Process.GetProcessesByName("QQ");
if (null != arr)
{
Process pro = arr[0];
foreach (ProcessThread thread in pro.Threads)
{
Console.WriteLine(String.Format("ID:{0} StartTime:{1} ThreadState{2}" , thread.Id , thread.StartTime , thread.ThreadState));
}
}