471,337 Members | 1,080 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

how to finde out in C# that a prossess "exe" is allready runningor not ?

how to finde out in C# that a prossess "exe" is allready running or not ?
and how to make programm wait 1 sec between checks?

thank you

Saleh Matani
Nov 30 '05 #1
5 1628
raj
i used the win32 api calls findwinow, etc in my last app
i am sure there are better ways


"Saleh Matani" <sa***@matani.net> wrote in message
news:uQ**************@TK2MSFTNGP10.phx.gbl...
how to finde out in C# that a prossess "exe" is allready running or not ?
and how to make programm wait 1 sec between checks?

thank you

Saleh Matani

Nov 30 '05 #2
raj
sorry didn t completely answer your question

i used FindWindow api calls for my last app, it wored well.

I would use a timer with interval of 1000 and on timer tick event call the
findwindow api.


"Saleh Matani" <sa***@matani.net> wrote in message
news:uQ**************@TK2MSFTNGP10.phx.gbl...
how to finde out in C# that a prossess "exe" is allready running or not ?
and how to make programm wait 1 sec between checks?

thank you

Saleh Matani

Nov 30 '05 #3

"Saleh Matani" <sa***@matani.net> wrote in message
news:uQ**************@TK2MSFTNGP10.phx.gbl...
how to finde out in C# that a prossess "exe" is allready running or not ?
and how to make programm wait 1 sec between checks?

thank you

Saleh Matani


To find an instance of a running process, you can use the static
"GetProcessesByName" method of the Process class.
You can set-up a timer using the various Timer classes in the framework,
check System.Timers, System.Threading.Timers or the
System.Windows.Forms.Timer classes.
Question is, why exactly do you need to know if an exe is already running?

Willy.

Nov 30 '05 #4
try the following line of code worked for me

Process[] arrProcess;
arrProcess=Process.GetProcesses(/* Conputer Name*/);

foreach (Process p in arrProcess)
{
if (p.ProcessName=="/*prossess "exe" name*/ ")
{
// Log the Event, here u can get when the process
is started or closed
}
}

"Saleh Matani" <sa***@matani.net> wrote in message
news:uQ**************@TK2MSFTNGP10.phx.gbl...
how to finde out in C# that a prossess "exe" is allready running or not ?
and how to make programm wait 1 sec between checks?

thank you

Saleh Matani

Dec 1 '05 #5
thank you :)

milk-jam wrote:
try the following line of code worked for me

Process[] arrProcess;
arrProcess=Process.GetProcesses(/* Conputer Name*/);

foreach (Process p in arrProcess)
{
if (p.ProcessName=="/*prossess "exe" name*/ ")
{
// Log the Event, here u can get when the process
is started or closed
}
}

"Saleh Matani" <sa***@matani.net> wrote in message
news:uQ**************@TK2MSFTNGP10.phx.gbl...
how to finde out in C# that a prossess "exe" is allready running or not ?
and how to make programm wait 1 sec between checks?

thank you

Saleh Matani


Dec 1 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by marco | last post: by
3 posts views Thread by Graham Mattingley | last post: by
reply views Thread by uballing | last post: by
3 posts views Thread by Dean Slindee | last post: by
2 posts views Thread by Anthony | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.