.net - C# wait for external PID to exit -


this question has answer here:

how wait until pid (not started program itself) doesn't exist longer? want program pid external program via commandline parameter , wait exit , something.

i searched it, find examples process has been startet c# program itself. that's easy manage ..

i going this, doesn't work ..

process[] pname = process.getprocessbyid(7860);             if (pname.length == 0)                 console.writeline("nothing");             else                 console.writeline("run"); 

how can accomplished?

you can writing:

var p = process.getprocessbyid(7860); p.waitforexit(); 

Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -