I've searched around and didn't find anything useful! :(
What i want is to have my C# app doing a command to a running process. This running process is a console application and i just need to enter the command "restart".. my try was:
Process[] processes= Process.GetProcessesByName("OpenSim.32BitLaunch");
foreach (Process p in processes)
{
p.StandardInput.WriteLine("restart");
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.UseShellExecute = false;
p.Start();
StreamWriter myStreamWriter = p.StandardInput;
myStreamWriter.WriteLine("tdfsffds");
p.StandardInput.WriteLine("restart");
p.StandardInput.Write("restart");
}
And i get and exectipon: StandardIn not redirected.I've tried also to set RedirectStandardInput but nothing ..
I've also tried with no success to do:
Process[] processes= Process.GetProcessesByName("OpenSim.32BitLaunch");
foreach (Process pin processes)
{
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.UseShellExecute = false;
p.Start();
StreamWriter myStreamWriter = p.StandardInput;
myStreamWriter.WriteLine("tdfsffds");
p.StandardInput.WriteLine("restart");
p.StandardInput.Write("restart");
}
And i get and exectipon: StandardIn not redirected.I've tried also to set RedirectStandardInput but nothing .. :(
Can anyone help me ?
Regards!