How to pass data in memory from PHP to a .Net program? I will use Process to call the php.exe, and pass in the script name (*.php) and the arguments.
The issue now is how do I pass back the data, from the PHP to the .Net?
Specifically, I am looking at the manner in which PHP can pass out the data so that .Net can intercept it. The .Net code I have are similar to this:
Process p = new Process();
StreamWriter sw;
StreamReader sr;
StreamReader err;
ProcessStartInfo psI = new ProcessStartInfo("cmd");
psI.UseShellExecute = false;
psI.RedirectStandardInput = true;
psI.RedirectStandardOutput = true;
psI.RedirectStandardError = true;
psI.CreateNoWindow = true;
p.StartInfo = psI;
p.Start();
sw = p.StandardInput;
sr = p.StandardOutput;
var text1 = sr.ReadToEnd(); // the php output should be able to be read by this statement
sw.Close();
Edit: Some suggest the use of XML, which is fine. But XML is a file based system; I would prefer a manner in which the interaction of data are passed in memory, just to prevent accidentally writing to the same XML file.