什么是从您自己的应用程序中获取当前进程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;