473,378 Members | 1,395 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 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 1706
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: marco | last post by:
Hi, first of all ; sorry for my poor english ; i'm french ... and i hope you can understand below I use python (and wxpython) on a win32 platform, to build a simple "home theater pc". I want...
3
by: Graham Mattingley | last post by:
Hello Group, I have had an issue on my server for a long time and what ever I have tryed I just cant fix it. I run mySQL and IIS, and my server will crash every few days because a file on the...
10
by: Vilmar Brazão de Oliveira | last post by:
HI people, what is wrong in the code bellow to kill iexplore.exe process after processing my page?? '»»Before comes routines to access data base and to send email. Set objWshell =...
0
by: uballing | last post by:
I am writing a "Windows Update" type application where via Web Services the client checks with the Server if he needs to download a newer version of a set of DLLs and EXE. If there is a newer...
2
by: Marek | last post by:
Actually, the very first question I should ask is "does it make sense at all?". For 2 days I've been trying to generate C# classes using XML schema and xsd.exe tool. So far the results are not...
3
by: bwalke | last post by:
I was wondering how the Process.Start() command can be used in a VB.NET Web Application. I have used this command in a Windows Application before successfully. I want the client side to envoke the...
3
by: Dean Slindee | last post by:
The code below is being used to launch WinWord.exe from a VB.NET program. Word launches, but displays this error message: "Word has experienced an error trying to open the file. Try these...
2
by: Anthony | last post by:
Hello All, Thanks for your help first, I wonder is there any link to sample or documentation that explain how to make .exe in C++ communicate to .exe in C#? I know there is some way like Share...
2
by: muttu2244 | last post by:
hi all i tried running a exe file info.exe from the spawnle cmd, its running fine from the interactive mode, but when i try to run the same info.exe file from a python file, its giving me the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.