Click here to Skip to main content
13,350,822 members (54,577 online)
Rate this:
 
Please Sign up or sign in to vote.
I have some windows application .exe which are run in my Domain server, i have a problem that if the .exe is stooped how can i get the notification that the .exe has stooped.

is there any solution thru i can manipulate my code with operating system and get notification thru mail or any other resource
Posted 24-Feb-14 18:19pm
Comments
   
Your tags are mess. I cannot believe it could be Objective-C, C# and VB.NET at the same time...
—SA

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

If you started some process in your code, you can capture the even when it is stopped, but, normally, you would need to handle it in a separate thread. This is not very expensive even if you want to track several external processes requiring a separate tracking thread per process, because most of the time such thread would be in the wait state, wasting no CPU time.

It could looks like this:
using System.Diagnostics;

//...

void SomeThreadStartMethod() {
    Process someExternalProcess = Process.Start("...", "..."); // some parameters
    someExternalProcess.WaitForExit();
    // invoke some event or handle it somehow...
}


If you are not starting your process in your server, you still can get the list of processes, choose one by some criteria and use a references to it to do the same wait. Please see:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process%28v=vs.110%29.aspx[^].

—SA
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web04 | 2.8.180111.1 | Last Updated 25 Feb 2014
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100