Getting the process ID

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know how to programmatically get the Process ID of a running
application in .Net? If so, could you share some code or point me to a
resource? Thanks!
 
System.Diagnostics.Process.GetCurrentProcess().Id;
System.Diagnostics.Process.GetProcessesByName("MyProcess")[0].Id;

In other words, check out "System.Diagnostics.Process" object.
 
Back
Top