I\'m from China, so my english maybe is really poor. I will try my best to make you understand my question. I want to use PHP CLI in my C# project. I tried code like this
<If I go by your code example the question does not make sense. However according to your question you can execute a PHP script from the CLI and collect the output using something like the following:
System.Diagnostics.Process proc = new System.Diagnostics.Process();
string sOutput = "";
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = "php.exe";
proc.StartInfo.Arguments = "-f file.php";
proc.StartInfo.RedirectStandardOutput = true;
System.IO.StreamReader hOutput = proc.StandardOutput;
proc.WaitForExit(2000);
if(proc.HasExited)
sOutput = hOutput.ReadToEnd();
Half of this code is my own and the rest I derived from a snippet I found via Google.
Hopefully this is what you are looking for.