110,537
社区成员
发帖
与我相关
我的任务
分享
class Program
{
static void Main()
{
PrintThreads(Process.GetCurrentProcess().Id);
}
private static void PrintThreads(int processId)
{
Process process = Process.GetProcessById(processId);
ProcessThreadCollection threads = process.Threads;
foreach (ProcessThread thread in threads)
{
Console.WriteLine("Thread Id : 0x{0}", thread.Id.ToString("X"));
}
}
}