tags:

views:

25

answers:

2

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

+1  A: 

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

int nProcessID = Process.GetCurrentProcess().Id;
luvieere
+1 for giving the namespace
Sam Holder
A: 

Process.GetCurrentProcess().Id

Joe