码迷,mamicode.com
首页 > 编程语言 > 详细

C# 获取当前进程、线程

时间:2017-10-10 20:32:55      阅读:188      评论:0      收藏:0      [点我收藏+]

标签:manage   line   bsp   nbsp   pre   color   console   read   获取   

//当前进程
Process current = Process.GetCurrentProcess();

//进程下线程
ProcessThreadCollection allThreads = current.Threads;

//当前线程
Console.WriteLine("ID:{0}", Thread.CurrentThread.ManagedThreadId);

 

C# 获取当前进程、线程

标签:manage   line   bsp   nbsp   pre   color   console   read   获取   

原文地址:http://www.cnblogs.com/Jasmine-K/p/7647295.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!