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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top