How to get the current ProcessID?

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

int nProcessID = Process.GetCurrentProcess().Id;

Leave a Comment