我想使用控制台查看线程的file location
和type
,例如createthread
或createprocess
和name of the thread
,我目前的解决方案是< / p>
Process proc = Process.GetProcessesByName("myprocessg").FirstOrDefault();
ProcessThreadCollection myThreads = proc.Threads;
Console.WriteLine("process: {0}, id: {1}", proc.ProcessName, proc.Id);
foreach (ProcessThread pt in myThreads)
{
Console.WriteLine(" thread: {0}", pt.Id);
Console.WriteLine(" CPU time: {0}", pt.TotalProcessorTime);
Console.WriteLine(" priority: {0}", pt.BasePriority);
}
我如何检索我上面发布的信息?