How to transfer data in memory from PHP to a .Net program? I will use Process to call php.exe and pass the script name (* .php) and arguments.
Now the problem is how to transfer data from PHP to .Net?
In particular, I am looking at how PHP can pass data so that .Net can intercept it. The .Net code I have is 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();
sw.Close();
Edit: some suggest using XML, which is good. But XML is a file system; I would prefer that data interaction be passed in memory to prevent accidental writing to the same XML file.
source
share