1 //当前进程 2 Process current = Process.GetCurrentProcess(); 3 //进程下线程 4 ProcessThreadCollection allThreads = current.Threads; 5 //当前线程 6 Console.WriteLine("ID:{0}", Thread.CurrentThread.ManagedThreadId);