如何获取当前的ProcessID?ProcessID

2023-09-04 07:21:56 作者:我会好好体味

什么是从您自己的应用程序中获取当前进程ID最简单的方式,使用.NET Framework?

What's the simplest way to obtain the current process ID from within your own application, using the .NET Framework?

推荐答案

获得一个参考当前进程,并使用 System.Diagnostics程序 Process.Id 属性:

Get a reference to the current process and use System.Diagnostics's Process.Id property:

int nProcessID = Process.GetCurrentProcess().Id;
相关推荐
 
精彩推荐
图片推荐