1. 程式人生 > >C# 獲取當前進程、線程

C# 獲取當前進程、線程

thread ber line current div read 獲取 進程 class

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

C# 獲取當前進程、線程