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?
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
}
}
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
}
}
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?
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.