I have this piece of code:
Process pLight = new Process();
pLight.StartInfo.UseShellExecute = false;
pLight.StartInfo.FileName = "MyCommand.exe";
//
pLight.StartInfo.Arguments = "-myparam 0";
pLight.Start();
//
pLight.StartInfo.Arguments = "-myparam 1";
pLight.Start();
//
pLight.StartInfo.Arguments = "-myparam 2";
pLight.Start();
The question is: a new process is “created” each time i invoke Start()?
From Process.Start documentation:
Returns true if a process resource is started; false if no new process resource is started (for example, if an existing process is reused).
but each time i invoke this method i get true. So how can I reuse the same process? Is there a way to run multiple commands using the same process?
Never done it myself but that’s what it appears to mean.