Tutorial :create a child process



Question:

You can create a thread given a delegate to method, can I create a process in the same way? I want to do that to be able to close the child process from task manager if something goes wrong.

I expect the answer is no and the only typical way is windows service.

Thanks


Solution:1

If by "same way", you mean passing a delegate as an argument for a given process then no, this is not possible. You will have to create a new executable which would do some tasks based on command line parameters. Though, the general rule is to avoid process spawning as it's VERY expensive.


Solution:2

Could try something like this (C#):

Process proc = new Process();  ProcessStartInfo procInfo = new ProcessStartInfo("C:\\test.exe");  proc.Start(procInfo);  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »