473,748 Members | 4,804 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1731
raj
i used the win32 api calls findwinow, etc in my last app
i am sure there are better ways


"Saleh Matani" <sa***@matani.n et> wrote in message
news:uQ******** ******@TK2MSFTN GP10.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.n et> wrote in message
news:uQ******** ******@TK2MSFTN GP10.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.n et> wrote in message
news:uQ******** ******@TK2MSFTN GP10.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
"GetProcessesBy Name" method of the Process class.
You can set-up a timer using the various Timer classes in the framework,
check System.Timers, System.Threadin g.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=Proc ess.GetProcesse s(/* 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.n et> wrote in message
news:uQ******** ******@TK2MSFTN GP10.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=Proc ess.GetProcesse s(/* 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.n et> wrote in message
news:uQ******** ******@TK2MSFTN GP10.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
3142
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 to release it in a package (with all needed to run) so i use (the wonderful) py2exe to build it ... it works like a charm ... nothing to say
3
3168
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 server called DLLHOST.EXE has taken all the memory, and the mySQL goes off line. I close all of the record sets, and all of the Text files I read, as below
10
7442
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 = Server.CreateObject("WScript.Shell") objWshell.Run "%COMSPEC% /C kill iexplore.exe", 0, TRUE VILMAR BRAZIL
0
352
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 version, I need to download the file from the server to the client. I wonder what is the best way to download a EXE without executing it when it arrives on the client. I have tried to using WebRequest and WebResponse, Stream, BinaryReader and...
2
32313
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 exciting but I assume I am seriously short of knowledge, so here I am - asking for help. My current situation is that I can define schemas that will generate very simple classes but I have two major problems: (1) I do not know how to write a...
3
5027
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 .exe application by clicking a button and want the .exe to run on the server. I have read in groups that it is not possible and also have heard that it is possible in Web Apps. Here is what I have tried so far in the web app... Dim myProcess...
3
11747
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 suggestions. 1) Check the file permissions for the document or drive. 2) Make sure there is sufficient free memory and disk space. 3) Open the file with the Text Recovery converter." The document that I want to display is on my PC and was created by...
2
2749
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 Memory, COM but I really need a place that I could get jump start Thanks Have a wonderful day Anthony
2
2517
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 following error: ############################################################## Traceback (most recent call last): File "C:\Documents and Settings\shivayogimath_dc\Desktop\network.py", line 56,
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9247
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8243
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.