摘要: 最简单的方式:var performanceCounter = new PerformanceCounter("Process", "Creating Process ID", "Child Process Name");不过这种方式有个很严重的问题就是效率。在我的测试机上,创建PerformanceCounter的时间超过了1.5秒。如果效率对你很重要的话,你可以考虑PInvoke方式。static Process GetParentProcess(Process childProcess){ IntPtr toolhelp32SnapshotHandle = WindowsSdk.Crea 阅读全文
posted @ 2010-12-07 11:09 夜深沉 阅读(382) 评论(0) 推荐(0)