Check if program is already running

G

Guest

Hi,
How can I check from C# code if outlook program if the process is already
running?
if not, I run outlook with:
System.Diagnostics.Process.Start("OUTLOOK.EXE");

Thank you!
 
M

Morten Wennevik [C# MVP]

Hi,
How can I check from C# code if outlook program if the process is already
running?
if not, I run outlook with:
System.Diagnostics.Process.Start("OUTLOOK.EXE");

Thank you!

Well, you could try to see if the Process exists
Process[] p = Process.GetProcessesByName("Outlook");
if p > 0, Outlook is running
 

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

Top